mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 06:08:34 +01:00
use undici instead :3
This commit is contained in:
parent
cbc4cbd1b5
commit
d9846a4a6c
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue