api/youtube: check if playability is ok after the status switch
This commit is contained in:
parent
3907697fa7
commit
8b15fe7863
1 changed files with 3 additions and 5 deletions
|
@ -146,9 +146,6 @@ export default async function(o) {
|
||||||
const basicInfo = info.basic_info;
|
const basicInfo = info.basic_info;
|
||||||
|
|
||||||
switch(playability.status) {
|
switch(playability.status) {
|
||||||
case "OK":
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "LOGIN_REQUIRED":
|
case "LOGIN_REQUIRED":
|
||||||
if (playability.reason.endsWith("bot")) {
|
if (playability.reason.endsWith("bot")) {
|
||||||
return { error: "youtube.login" }
|
return { error: "youtube.login" }
|
||||||
|
@ -175,8 +172,9 @@ export default async function(o) {
|
||||||
|
|
||||||
case "AGE_VERIFICATION_REQUIRED":
|
case "AGE_VERIFICATION_REQUIRED":
|
||||||
return { error: "content.video.age" };
|
return { error: "content.video.age" };
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
if (playability.status !== "OK") {
|
||||||
return { error: "content.video.unavailable" };
|
return { error: "content.video.unavailable" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue