From f129b603955e04b9429cf694717ec1ac0103496c Mon Sep 17 00:00:00 2001 From: Ashley Date: Tue, 20 Dec 2022 17:16:22 +0000 Subject: [PATCH] fix isvalidvideo - gonna check if this is valid --- src/libpoketube/libpoketube-core.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index d4ed0cf1..4cf2d694 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -144,11 +144,21 @@ async function isvalidvideo(v) { if (v != "assets") { var status; - const vld = await fetch(`${config.dislikes}${v}`).then((res) => { - status = res.status; - return res.json(); - }); + async function ryd() { + try { + const engagement = await fetch(`${config.dislikes}${v}`).then((res) => + res.json() + ); + return engagement; + } catch {} + } + if (ryd.status) { + status = await ryd.status(); + } else { + status = "200"; + } + if (status == 400) { return false; } else {