diff --git a/src/libpoketube/init/pages-404-and-main.js b/src/libpoketube/init/pages-404-and-main.js index f33f3d08..b2791394 100644 --- a/src/libpoketube/init/pages-404-and-main.js +++ b/src/libpoketube/init/pages-404-and-main.js @@ -66,13 +66,14 @@ module.exports = function (app, config, renderTemplate) { } return renderTemplate(res, req, "landing.ejs"); }; - + if (req.params.v && /[a-zA-Z0-9]+/.test(req.param.v)) { const isvld = await core.isvalidvideo(req.params.v); if (isvld) { return res.redirect(`/watch?v=${req.params.v}`); } } + return rendermainpage(); }); };