From 8229cc46b650fb42b50d2df2dfc7f2b70ec3546f Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 4 Jan 2024 15:51:08 +0000 Subject: [PATCH] add @youtube.com url support --- src/libpoketube/init/pages-channel-and-download.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libpoketube/init/pages-channel-and-download.js b/src/libpoketube/init/pages-channel-and-download.js index 65fdb87e..f8c61591 100644 --- a/src/libpoketube/init/pages-channel-and-download.js +++ b/src/libpoketube/init/pages-channel-and-download.js @@ -257,8 +257,13 @@ module.exports = function (app, config, renderTemplate) { app.get("/channel/", async (req, res) => { const { fetch } = await import("undici"); try { - const ID = req.query.id; - const tab = req.query.tab; + + var ID = req.query.id; + + if (ID.endsWith('@youtube.com')) { + ID = ID.slice(0, -'@youtube.com'.length); + } + const tab = req.query.tab; const cache = {}; try {