add more redirects

This commit is contained in:
Ashley 2022-12-24 12:30:31 +00:00
parent ecac0323b7
commit 3f7bd826f5

View file

@ -37,6 +37,22 @@ module.exports = function (app, config, renderTemplate) {
return res.redirect(`/watch?v=${req.params.id}&from=short`); return res.redirect(`/watch?v=${req.params.id}&from=short`);
}); });
app.get("/v/:id", (req, res) => {
if (!req.params.id) {
return res.redirect("/");
}
return res.redirect(`/watch?v=${req.params.id}&from=v_url`);
});
app.get("/c/:id", (req, res) => {
if (!req.params.id) {
return res.redirect("/");
}
return res.redirect(`/channel?id=${req.params.id}&from=c_channel_url`);
});
app.get("/video/upload", (req, res) => { app.get("/video/upload", (req, res) => {
res.redirect("https://youtube.com/upload"); res.redirect("https://youtube.com/upload");
}); });