From bd5d8d5f9059aec2b8cfb2bab1d372d04edaccfb Mon Sep 17 00:00:00 2001 From: ashley Date: Fri, 29 Aug 2025 18:23:23 +0200 Subject: [PATCH] add channelurlfixer to channels --- src/libpoketube/init/pages-channel-and-download.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libpoketube/init/pages-channel-and-download.js b/src/libpoketube/init/pages-channel-and-download.js index d19438a5..4dedb2e0 100644 --- a/src/libpoketube/init/pages-channel-and-download.js +++ b/src/libpoketube/init/pages-channel-and-download.js @@ -196,6 +196,15 @@ module.exports = function (app, config, renderTemplate) { res.redirect("/"); }); +function channelurlfixer(text) { + // Create a regular expression to match tags with href containing "/channel/" + const regex = / tags with the modified href attribute + const updatedDescription = text.replace(regex, ' { const { fetch } = await import("undici"); try { @@ -268,6 +277,8 @@ module.exports = function (app, config, renderTemplate) { const pronoun = "no pronouns :c"; + + var [tj, shorts, playlist, stream, c, cinv] = await Promise.all([ getChannelData(channelUrl), getChannelData(shortsUrl), @@ -334,6 +345,7 @@ module.exports = function (app, config, renderTemplate) { j: "", dnoreplace:"", sort: sort_by, + channelurlfixer, stream, tj, c,