From 87b98e0ad23262f910a8750d14d30262f3d000a1 Mon Sep 17 00:00:00 2001 From: Ashley Date: Tue, 7 Nov 2023 14:55:10 +0000 Subject: [PATCH] add get thubnail --- src/libpoketube/init/pages-api.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libpoketube/init/pages-api.js b/src/libpoketube/init/pages-api.js index 1ecaef89..f12b7baa 100644 --- a/src/libpoketube/init/pages-api.js +++ b/src/libpoketube/init/pages-api.js @@ -37,7 +37,18 @@ module.exports = function (app, config, renderTemplate) { app.get("/embed/:v", async function (req, res) { res.send("Disabled until further notice"); }); + + app.get("/vi/:v/:t", async function (req, res) { + var url = `https://i.ytimg.com/vi/${req.params.v}/${req.params.t}` + + let f = await modules.fetch(url + `?cachefixer=${btoa(Date.now())}`, { + method: req.method, + }); + f.body.pipe(res); + + }); + app.get("/api/search", async (req, res) => { const query = req.query.query;