From 624454c1349940066d8f5c372b685670427c7322 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 24 Mar 2023 20:54:46 +0000 Subject: [PATCH] remov isvalidvideo as its not needed anymore :3 --- src/libpoketube/libpoketube-core.js | 30 +++++------------------------ 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 221d8a16..afa3b31c 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -20,8 +20,7 @@ const fetcher = require("../libpoketube/libpoketube-fetcher.js"); const getColors = require("get-image-colors"); const wiki = require("wikipedia"); -const sqp = - "-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw"; +const sqp = "-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw"; const config = { tubeApi: "https://inner-api.poketube.fun/api/", @@ -184,31 +183,12 @@ async function search(query, cnt) { } async function isvalidvideo(v) { - if (v != "assets") { - var status; - - 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 { + if (v != "assets") { return true; + } else { + return false; } - } -} + } module.exports = { search,