mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 06:34:40 -05:00
add try catch :p
This commit is contained in:
parent
ab42b34418
commit
a7c3d42b78
1 changed files with 28 additions and 24 deletions
|
@ -128,6 +128,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
const h = await video.text();
|
const h = await video.text();
|
||||||
const k = JSON.parse(modules.toJson(h));
|
const k = JSON.parse(modules.toJson(h));
|
||||||
if (!v) res.redirect("/");
|
if (!v) res.redirect("/");
|
||||||
|
try {
|
||||||
if ("Formats" in fetching.video.Player) {
|
if ("Formats" in fetching.video.Player) {
|
||||||
//video
|
//video
|
||||||
const j = fetching.video.Player.Formats.Format,
|
const j = fetching.video.Player.Formats.Format,
|
||||||
|
@ -158,6 +159,9 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
res.json("error in parsing");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/watch", async function (req, res) {
|
app.get("/watch", async function (req, res) {
|
||||||
|
|
Loading…
Reference in a new issue