api/youtube: return a proper error if the video is "inappropriate"

This commit is contained in:
wukko 2025-02-13 17:09:03 +06:00
parent 33ce314775
commit b5ba86dd75
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -193,7 +193,7 @@ export default async function (o) {
if (playability.reason.endsWith("bot")) { if (playability.reason.endsWith("bot")) {
return { error: "youtube.login" } return { error: "youtube.login" }
} }
if (playability.reason.endsWith("age")) { if (playability.reason.endsWith("age") || playability.reason.endsWith("inappropriate for some users.")) {
return { error: "content.video.age" } return { error: "content.video.age" }
} }
if (playability?.error_screen?.reason?.text === "Private video") { if (playability?.error_screen?.reason?.text === "Private video") {