api/youtube: catch token expiration error

This commit is contained in:
wukko 2024-08-24 18:34:02 +06:00
parent 856004366e
commit 0bbf822d70
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -111,6 +111,8 @@ export default async function(o) {
} catch(e) {
if (e.message?.endsWith("decipher algorithm")) {
return { error: "youtube.decipher" }
} else if (e.message?.includes("refresh access token")) {
return { error: "youtube.token_expired" }
} else throw e;
}