api/youtube: don't use session if user wants subtitles

cuz they're not currently available anywhere but HLS
This commit is contained in:
wukko 2025-06-20 17:27:49 +06:00
parent 993a885a3e
commit 7ce9d6882b
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -175,14 +175,13 @@ export default async function (o) {
useHLS = false;
}
// we can get subtitles reliably only from the iOS client
if (useHLS || o.subtitleLang) {
if (useHLS) {
innertubeClient = "IOS";
}
// iOS client doesn't have adaptive formats of resolution >1080p,
// so we use the WEB_EMBEDDED client instead for those cases
const useSession =
let useSession =
env.ytSessionServer && (
(
!useHLS
@ -194,6 +193,12 @@ export default async function (o) {
)
);
// we can get subtitles reliably only from the iOS client
if (o.subtitleLang) {
innertubeClient = "IOS";
useSession = false;
}
if (useSession) {
innertubeClient = env.ytSessionInnertubeClient || "WEB_EMBEDDED";
}