Skip to content

best way to save what you love

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

wukkob5ba86dd7578
diff --git a/api/src/processing/services/youtube.js b/api/src/processing/services/youtube.js
index 3240c163..a4c54a82 100644
--- a/api/src/processing/services/youtube.js
+++ b/api/src/processing/services/youtube.js
@@ -193,7 +193,7 @@ export default async function (o) {
if (playability.reason.endsWith("bot")) {
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" }
}
if (playability?.error_screen?.reason?.text === "Private video") {