Skip to content

Commit 6b0f1ea

Browse files
Merge commit '3826cf7b1dc5de67ce7367700c927f048703fe53' into rollback-unintended-changes
2 parents 48876fa + 3826cf7 commit 6b0f1ea

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
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,

src/renderer/helpers/api/local.js

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

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

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

248259
if (mwebInfo.playability_status.status === 'OK' && mwebInfo.streaming_data) {
@@ -252,6 +263,8 @@ export async function getLocalVideoInfo(id) {
252263
clientName = 'MWEB'
253264
}
254265

266+
// #endregion temporary workaround for SABR-only responses
267+
255268
let hasTrailer = info.has_trailer
256269
let trailerIsAgeRestricted = info.getTrailerInfo() === null
257270

@@ -339,6 +352,10 @@ export async function getLocalVideoInfo(id) {
339352
url.searchParams.set('pot', contentPoToken)
340353
url.searchParams.set('c', clientName)
341354

355+
// Remove &xosf=1 as it adds `position:63% line:0%` to the subtitle lines
356+
// placing them in the top right corner
357+
url.searchParams.delete('xosf')
358+
342359
captionTrack.base_url = url.toString()
343360
}
344361
}

0 commit comments

Comments
 (0)