api/youtube: expect errorInfo to not be json

This commit is contained in:
jj 2025-02-08 20:59:53 +00:00
parent a918b12387
commit 3f6dd4fced
No known key found for this signature in database

View file

@ -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" };