Skip to content

best way to save what you love

api/youtube: expect errorInfo to not be json

jj3f6dd4fced0e
diff --git a/api/src/processing/services/youtube.js b/api/src/processing/services/youtube.js
index f0766b3f..3240c163 100644
--- a/api/src/processing/services/youtube.js
+++ b/api/src/processing/services/youtube.js
@@ -165,7 +165,8 @@ export default async function (o) {
info = await yt.getBasicInfo(o.id, innertubeClient);
} catch (e) {
if (e?.info) {
- const errorInfo = JSON.parse(e?.info);
+ let errorInfo;
+ try { errorInfo = JSON.parse(e?.info); } catch {}
if (errorInfo?.reason === "This video is private") {
return { error: "content.video.private" };