From d9846a4a6c761b493a6edda526c3f645ec9b1641 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 17 Sep 2023 19:43:43 +0000 Subject: [PATCH] use undici instead :3 --- src/libpoketube/init/pages-api.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libpoketube/init/pages-api.js b/src/libpoketube/init/pages-api.js index c9335303..5c811762 100644 --- a/src/libpoketube/init/pages-api.js +++ b/src/libpoketube/init/pages-api.js @@ -64,13 +64,15 @@ module.exports = function (app, config, renderTemplate) { }); app.get("/api/subtitles", async (req, res) => { + const { fetch } = await import("undici"); + const id = req.query.v; const l = req.query.h; try { let url = `https://invid-api.poketube.fun/api/v1/captions/${id}?label=${l}`; - let f = await modules.fetch(url); + let f = await fetch(url); const body = await f.text(); res.send(body);