From 13a37b7b6985cc84a19d2909624dec17995e776b Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Thu, 29 Feb 2024 19:52:44 +0000 Subject: [PATCH] test this --- src/libpoketube/init/pages-channel-and-download.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libpoketube/init/pages-channel-and-download.js b/src/libpoketube/init/pages-channel-and-download.js index 121458d0..a5b3fab8 100644 --- a/src/libpoketube/init/pages-channel-and-download.js +++ b/src/libpoketube/init/pages-channel-and-download.js @@ -176,10 +176,13 @@ module.exports = function (app, config, renderTemplate) { const { fetch } = await import("undici"); - const search = await fetch( - `https://search.zeroish.xyz/api.php?q=${query}&p=1&t=0` - ); - const web = getJson(await search.text()); + let allResults = []; + + for (let page = 1; page <= 3; page++) { + const search = await fetch(`https://search.zeroish.xyz/api.php?q=${query}&p=${page}&t=0`); + const results = await search.json(); + allResults = allResults.concat(results); +} if (req.query.lucky === "true") { res.redirect("/im-feeling-lucky?query=" + query); @@ -218,7 +221,7 @@ module.exports = function (app, config, renderTemplate) { let continuation = req.query.continuation || ""; try { - const results = web; + const results = allResults; renderTemplate(res, req, "search-web.ejs", { j: "",