add more redirects

This commit is contained in:
Ashley 2022-12-24 12:30:31 +00:00
parent 469d44150e
commit f177f45a99

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");
}); });