From cfb0176d218a63a3073d2d1b7a93cc5889547d6c Mon Sep 17 00:00:00 2001 From: Ashley Date: Tue, 20 Dec 2022 20:19:02 +0000 Subject: [PATCH] add description check :p --- src/libpoketube/libpoketube-core.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 4cf2d694..99bf02eb 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -72,7 +72,7 @@ async function video(v) { if (v == null) return "Gib ID"; let nightlyRes; - var desc; + var desc = ""; var inv_comments = await fetch(`${config.invapi}/comments/${v}`).then((res) => res.text() @@ -98,11 +98,7 @@ async function video(v) { summary_.title !== "Not found." ? summary_ : "none" ); - if (a.Channel?.Contents.ItemSection.About) { - desc = a.Channel?.Contents.ItemSection.About.Description; - } else { - desc = "No about section"; - } + desc = a.Channel?.Contents?.ItemSection?.About?.Description; const data = await fetcher(v); @@ -158,7 +154,7 @@ async function isvalidvideo(v) { } else { status = "200"; } - + if (status == 400) { return false; } else {