From 42a3f605d70f73d2c1602a82c894465a61d700b6 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 30 Sep 2023 20:20:29 +0000 Subject: [PATCH] use undici instead :3 --- src/libpoketube/init/pages-404-and-main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libpoketube/init/pages-404-and-main.js b/src/libpoketube/init/pages-404-and-main.js index d5f5e34f..89f6a4e8 100644 --- a/src/libpoketube/init/pages-404-and-main.js +++ b/src/libpoketube/init/pages-404-and-main.js @@ -33,6 +33,8 @@ function getJson(str) { module.exports = function (app, config, renderTemplate) { app.get("/app", async function (req, res) { + const { fetch } = await import("undici"); + let tab = ""; if (req.query.tab) { tab = `/?type=${capitalizeFirstLetter(req.query.tab)}`; @@ -47,7 +49,7 @@ module.exports = function (app, config, renderTemplate) { if (req.query.mobilesearch) { const query = req.query.mobilesearch; const continuation = req.query.continuation || ""; - const search = await modules.fetch( + const search = await fetch( `https://inner-api.poketube.fun/api/search?query=${query}&continuation=${continuation}` ); const text = await search.text();