add try catch :p

This commit is contained in:
Ashley 2023-01-07 19:15:27 +00:00
parent ef27eaf1cd
commit 8f5780b09f

View file

@ -178,10 +178,6 @@ module.exports = function (app, config, renderTemplate) {
var q = req.query.quality; var q = req.query.quality;
var a = req.query.a; 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); const isvld = await core.isvalidvideo(v);
if (!v) res.redirect("/"); if (!v) res.redirect("/");
@ -200,6 +196,10 @@ module.exports = function (app, config, renderTemplate) {
} }
try { try {
const info = await modules.fetch("http://ip-api.com/json/");
const jj = await info.text();
const ip = JSON.parse(jj);
if (isvld) { if (isvld) {
core.video(v).then((data) => { core.video(v).then((data) => {
if (data) { if (data) {