mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 09:28:29 +00:00
api/youtube: don't use session if user wants subtitles
cuz they're not currently available anywhere but HLS
This commit is contained in:
parent
993a885a3e
commit
7ce9d6882b
@ -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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user