From 8f5780b09fc874aae312943ecf1f8decd4466b0f Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 7 Jan 2023 19:15:27 +0000 Subject: [PATCH] add try catch :p --- src/libpoketube/init/pages-video.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index 99f2cf13..191d4a38 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -178,10 +178,6 @@ module.exports = function (app, config, renderTemplate) { var q = req.query.quality; var a = req.query.a; - const info = await modules.fetch("http://ip-api.com/json/"); - const jj = await info.text(); - const ip = JSON.parse(jj); - const isvld = await core.isvalidvideo(v); if (!v) res.redirect("/"); @@ -200,6 +196,10 @@ module.exports = function (app, config, renderTemplate) { } try { + const info = await modules.fetch("http://ip-api.com/json/"); + const jj = await info.text(); + const ip = JSON.parse(jj); + if (isvld) { core.video(v).then((data) => { if (data) {