From 35af3566c463e07041d6af12ea6e342416de58d3 Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 3 Nov 2022 18:44:29 +0100 Subject: [PATCH] mobile search pog --- server.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/server.js b/server.js index 4e7b24b1..b723628a 100644 --- a/server.js +++ b/server.js @@ -608,13 +608,36 @@ app.get("/", async function (req, res) { ).then((res) => res.text()); const t = JSON.parse(invtrend); + + if(req.query.mobilesearch) { + var query = req.query.mobilesearch; +tab = "search" + if (req.query.continuation) { + var continuation = req.query.continuation; + } + if (!req.query.continuation) { + var continuation = ""; + } + const search = await modules.fetch( + `https://tube.kuylar.dev/api/search?query=${query}&continuation=${continuation}` + ); + + const text = await search.text(); + var j = JSON.parse(modules.toJson(text)); + + + } + renderTemplate(res, req, "main.ejs", { k: k, tab: req.query.tab, isMobile: req.useragent.isMobile, + mobilesearch:req.query.mobilesearch, inv: t, turntomins, + continuation, + j }); });