Skip to content

Commit d5c5ca7

Browse files
Merge remote-tracking branch 'upstream/master' into release
2 parents 9afd63d + 3826cf7 commit d5c5ca7

File tree

4 files changed

+346
-357
lines changed

4 files changed

+346
-357
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "freetube",
33
"productName": "FreeTube",
44
"description": "A private YouTube client",
5-
"version": "0.23.6",
5+
"version": "0.23.7",
66
"license": "AGPL-3.0-or-later",
77
"main": "./dist/main.js",
88
"private": true,
@@ -70,14 +70,14 @@
7070
"core-js": "^3.41.0",
7171
"portal-vue": "^2.1.7",
7272
"process": "^0.11.10",
73-
"shaka-player": "^4.14.25",
74-
"swiper": "^11.2.10",
73+
"shaka-player": "^4.13.4",
74+
"swiper": "^11.2.1",
7575
"vue": "^2.7.16",
7676
"vue-i18n": "^8.28.2",
7777
"vue-observe-visibility": "^1.0.0",
7878
"vue-router": "^3.6.5",
7979
"vuex": "^3.6.2",
80-
"youtubei.js": "^15.0.1"
80+
"youtubei.js": "^15.0.0"
8181
},
8282
"devDependencies": {
8383
"@babel/core": "^7.28.0",
@@ -88,14 +88,14 @@
8888
"babel-loader": "^10.0.0",
8989
"copy-webpack-plugin": "^13.0.0",
9090
"css-loader": "^7.1.2",
91-
"css-minimizer-webpack-plugin": "^7.0.2",
92-
"electron": "^37.2.5",
93-
"electron-builder": "^26.0.19",
94-
"eslint": "^9.32.0",
95-
"eslint-plugin-jsdoc": "^52.0.2",
96-
"eslint-plugin-jsonc": "^2.20.1",
97-
"eslint-plugin-unicorn": "^60.0.0",
98-
"eslint-plugin-vue": "^10.4.0",
91+
"css-minimizer-webpack-plugin": "^7.0.0",
92+
"electron": "^34.0.1",
93+
"electron-builder": "^26.0.13",
94+
"eslint": "^9.19.0",
95+
"eslint-plugin-jsdoc": "^50.6.3",
96+
"eslint-plugin-jsonc": "^2.19.1",
97+
"eslint-plugin-unicorn": "^56.0.1",
98+
"eslint-plugin-vue": "^9.32.0",
9999
"eslint-plugin-vuejs-accessibility": "^2.4.1",
100100
"eslint-plugin-yml": "^1.18.0",
101101
"globals": "^16.3.0",

src/renderer/helpers/api/local.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,18 @@ export async function getLocalVideoInfo(id) {
239239

240240
const info = await webInnertube.getInfo(id, { po_token: contentPoToken })
241241

242-
// temporary workaround for SABR-only responses
242+
// #region temporary workaround for SABR-only responses
243+
244+
// MWEB doesn't have an audio track selector so it picks the audio track on the server based on the request language.
245+
246+
const originalAudioTrackFormat = info.streaming_data?.adaptive_formats.find(format => {
247+
return format.has_audio && format.is_original && format.language
248+
})
249+
250+
if (originalAudioTrackFormat) {
251+
webInnertube.session.context.client.hl = originalAudioTrackFormat.language
252+
}
253+
243254
const mwebInfo = await webInnertube.getBasicInfo(id, { client: 'MWEB', po_token: contentPoToken })
244255

245256
if (mwebInfo.playability_status.status === 'OK' && mwebInfo.streaming_data) {
@@ -249,6 +260,8 @@ export async function getLocalVideoInfo(id) {
249260
clientName = 'MWEB'
250261
}
251262

263+
// #endregion temporary workaround for SABR-only responses
264+
252265
let hasTrailer = info.has_trailer
253266
let trailerIsAgeRestricted = info.getTrailerInfo() === null
254267

@@ -353,6 +366,22 @@ export async function getLocalVideoInfo(id) {
353366
}
354367
}
355368

369+
if (info.captions?.caption_tracks) {
370+
for (const captionTrack of info.captions.caption_tracks) {
371+
const url = new URL(captionTrack.base_url)
372+
373+
url.searchParams.set('potc', '1')
374+
url.searchParams.set('pot', contentPoToken)
375+
url.searchParams.set('c', clientName)
376+
377+
// Remove &xosf=1 as it adds `position:63% line:0%` to the subtitle lines
378+
// placing them in the top right corner
379+
url.searchParams.delete('xosf')
380+
381+
captionTrack.base_url = url.toString()
382+
}
383+
}
384+
356385
return info
357386
}
358387

src/renderer/views/Playlist/Playlist.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
:info-source="infoSource"
3333
:more-video-data-available="moreVideoDataAvailable"
3434
:search-video-mode-allowed="isUserPlaylistRequested && shownVideoCount > 1"
35+
:search-video-mode-enabled="playlistInVideoSearchMode"
3536
:search-query-text="searchQueryTextRequested"
3637
:theme="listType === 'list' ? 'base' : 'top-bar'"
3738
class="playlistInfo"

0 commit comments

Comments
 (0)