From 8fbc2c308f99abafb1b914554d26289c8dd99484 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 12 Oct 2022 21:54:34 +0200 Subject: [PATCH] hashtags! --- server.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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"); });