api/youtube: disable HLS if a session server is used

This commit is contained in:
wukko 2025-03-19 20:34:56 +06:00
parent 4e6d1c4051
commit d1b5983e49
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -151,22 +151,16 @@ export default async function (o) {
} else throw e;
}
const cookie = getCookie('youtube')?.toString();
let useHLS = o.youtubeHLS;
// HLS playlists don't contain the av1 video format, at least with the iOS client
if (useHLS && o.format === "av1") {
// HLS playlists don't contain the av1 video format.
// if the session server is used, then iOS client will not work, at least currently.
if (useHLS && (o.format === "av1" || env.ytSessionServer)) {
useHLS = false;
}
let innertubeClient = o.innertubeClient || env.customInnertubeClient || "ANDROID";
if (cookie) {
useHLS = false;
innertubeClient = "WEB";
}
if (useHLS) {
innertubeClient = "IOS";
}