diff --git a/server.js b/server.js index a5274094..9e77b43f 100644 --- a/server.js +++ b/server.js @@ -592,6 +592,16 @@ app.get("/api/subtitles", async (req, res) => { res.send(body); }); +app.get("/api/redirect", async (req, res) => { + const red_url = req.query.u; + + if (!red_url) { + res.redirect("/"); + } + + res.redirect(red_url); +}); + app.get("/api/opensearch", async (req, res) => { res.sendFile(__dirname + `/opensearch.xml`); }); @@ -606,6 +616,14 @@ app.get("/discover", async function (req, res) { res.redirect("/"); }); +app.get("/hashtag/:id", (req, res) => { + if (!req.params.id) { + return res.redirect("/"); + } + + return res.redirect(`/search?query=${req.params.id}&from=hashtag`); +}); + app.get("/video/upload", (req, res) => { res.redirect("https://youtube.com/upload"); });