From acaaae8759b434d1db78e7662fb0a889f546aa5e Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 15 Jul 2022 16:29:02 +0300 Subject: [PATCH] New feed --- server.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index d652ba10..f28e1edc 100644 --- a/server.js +++ b/server.js @@ -190,7 +190,7 @@ app.get("/old/watch", async function (req, res) { lyrics: lyrics.replace(/\n/g, "
"), }); }); -app.get("/", async function (req, res) { +app.get("/feed/discover/trends", async function (req, res) { const trends = await fetch(config.tubeApi + `trending`); const h = await trends.text(); const k = JSON.parse(toJson(h)); @@ -256,10 +256,15 @@ app.get("/search", async (req, res) => { app.get("/css/:id", (req, res) => { res.sendFile(__dirname + `/css/${req.params.id}`); }); - +app.get("/js/:id", (req, res) => { + res.sendFile(__dirname + `/js/${req.params.id}`); +}); app.get("/video/upload", (req, res) => { res.redirect("https://youtube.com/upload?from=poketube_utc"); }); +app.get("/", (req, res) => { + res.redirect("/feed/discover/trends?param=/"); +}); app.get("/api/video/download", async function (req, res) { var v = req.query.v; var fetching = await fetcher(v);