youtube: catch cipher errors

not the first and seemingly not the last time it's gonna happen
This commit is contained in:
wukko
2024-08-01 07:43:51 +06:00
parent f8a28c6c5f
commit f5facc7d39
2 changed files with 6 additions and 2 deletions

View File

@@ -50,7 +50,9 @@ const transformSessionData = (cookie) => {
const cloneInnertube = async (customFetch) => {
const innertube = await ytBase;
if (innertube instanceof Error) {
throw innertube;
if (innertube?.message?.endsWith("decipher algorithm")) {
return { error: "ErrorYoutubeDecipher" }
} else throw innertube;
}
const session = new Session(
@@ -101,6 +103,7 @@ export default async function(o) {
dispatcher: o.dispatcher
})
);
if (yt.error) return yt;
const quality = o.quality === "max" ? "9000" : o.quality;