mirror of
https://github.com/wukko/cobalt.git
synced 2025-02-13 22:26:28 +01:00
api/youtube: expect errorInfo to not be json
This commit is contained in:
parent
a918b12387
commit
3f6dd4fced
1 changed files with 2 additions and 1 deletions
|
@ -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" };
|
||||
|
|
Loading…
Reference in a new issue