From d7c2694d378f5f3230fc80ba9313cc919164d3b0 Mon Sep 17 00:00:00 2001 From: Ashley Date: Tue, 7 Nov 2023 16:00:57 +0000 Subject: [PATCH] add stuff --- src/libpoketube/init/pages-api.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libpoketube/init/pages-api.js b/src/libpoketube/init/pages-api.js index 8464be19..64767ac6 100644 --- a/src/libpoketube/init/pages-api.js +++ b/src/libpoketube/init/pages-api.js @@ -49,15 +49,24 @@ module.exports = function (app, config, renderTemplate) { }); - app.get("/avatars/:v", async function (req, res) { - var url = `https://yt3.ggpht.com/${req.params.v}` - - let f = await modules.fetch(url + `?cachefixer=${btoa(Date.now())}`, { +app.get("/avatars/:v", async function (req, res) { + var url = `https://yt3.ggpht.com/${req.params.v}`; + + let f = await modules.fetch(url + `?cachefixer=${btoa(Date.now())}`, { method: req.method, }); f.body.pipe(res); + }); + app.get("/avatars/ytc/:v", async function (req, res) { + var url = `https://yt3.ggpht.com/ytc/${req.params.v.replace("ytc", "")}`; + + let f = await modules.fetch(url + `?cachefixer=${btoa(Date.now())}`, { + method: req.method, + }); + + f.body.pipe(res); });