mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 10:58:25 +01:00
add try catch :p
This commit is contained in:
parent
d81d66b461
commit
517f67958c
1 changed files with 4 additions and 0 deletions
|
@ -30,6 +30,7 @@ function getJson(str) {
|
||||||
|
|
||||||
module.exports = function (app, config, renderTemplate) {
|
module.exports = function (app, config, renderTemplate) {
|
||||||
app.get("/download", async function (req, res) {
|
app.get("/download", async function (req, res) {
|
||||||
|
try {
|
||||||
var v = req.query.v;
|
var v = req.query.v;
|
||||||
|
|
||||||
// video
|
// video
|
||||||
|
@ -53,6 +54,9 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
.getColors(`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`)
|
.getColors(`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`)
|
||||||
.then((colors) => colors[0].hex()),
|
.then((colors) => colors[0].hex()),
|
||||||
});
|
});
|
||||||
|
} catch {
|
||||||
|
res.redirect("/")
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/old/watch", async function (req, res) {
|
app.get("/old/watch", async function (req, res) {
|
||||||
|
|
Loading…
Reference in a new issue