api/youtube: check if playability is ok after the status switch

This commit is contained in:
wukko 2024-10-26 22:49:16 +06:00
parent 3907697fa7
commit 8b15fe7863
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -146,9 +146,6 @@ export default async function(o) {
const basicInfo = info.basic_info;
switch(playability.status) {
case "OK":
break;
case "LOGIN_REQUIRED":
if (playability.reason.endsWith("bot")) {
return { error: "youtube.login" }
@ -175,9 +172,10 @@ export default async function(o) {
case "AGE_VERIFICATION_REQUIRED":
return { error: "content.video.age" };
}
default:
return { error: "content.video.unavailable" };
if (playability.status !== "OK") {
return { error: "content.video.unavailable" };
}
if (basicInfo.is_live) {