From 7ce9d6882bca9091542654fb0aa7bea4b019da66 Mon Sep 17 00:00:00 2001 From: wukko Date: Fri, 20 Jun 2025 17:27:49 +0600 Subject: [PATCH] api/youtube: don't use session if user wants subtitles cuz they're not currently available anywhere but HLS --- api/src/processing/services/youtube.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/api/src/processing/services/youtube.js b/api/src/processing/services/youtube.js index b26f7358..f05e3086 100644 --- a/api/src/processing/services/youtube.js +++ b/api/src/processing/services/youtube.js @@ -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"; }