From 8b15fe78637588a71c34dc712ef6c689e114d340 Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 26 Oct 2024 22:49:16 +0600 Subject: [PATCH] api/youtube: check if playability is ok after the status switch --- api/src/processing/services/youtube.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/api/src/processing/services/youtube.js b/api/src/processing/services/youtube.js index e2f83c5d..7517c351 100644 --- a/api/src/processing/services/youtube.js +++ b/api/src/processing/services/youtube.js @@ -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) {