Skip to content

best way to save what you love

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

wukko8b15fe786375
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) {