mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 20:18:08 +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) {
|
||||
app.get("/download", async function (req, res) {
|
||||
try {
|
||||
var v = req.query.v;
|
||||
|
||||
// video
|
||||
|
@ -53,6 +54,9 @@ module.exports = function (app, config, renderTemplate) {
|
|||
.getColors(`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`)
|
||||
.then((colors) => colors[0].hex()),
|
||||
});
|
||||
} catch {
|
||||
res.redirect("/")
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/old/watch", async function (req, res) {
|
||||
|
|
Loading…
Reference in a new issue