Update src/libpoketube/init/pages-channel-and-download.js

This commit is contained in:
ashley 2025-08-18 10:25:35 +02:00
parent 3918bd53b5
commit 1de34b0a4d

View File

@ -218,19 +218,6 @@ module.exports = function (app, config, renderTemplate) {
const tab = req.query.tab;
const cache = {};
try {
// about
const bout = await fetch(config.tubeApi + `channel?id=${ID}&tab=about`, {
headers: {
'User-Agent': config.useragent,
},
});
const h = await bout.text();
var boutJson = JSON.parse(modules.toJson(h));
} catch {
boutJson = " ";
}
const continuation = req.query.continuation
? `&continuation=${req.query.continuation}`
: "";
@ -322,17 +309,16 @@ module.exports = function (app, config, renderTemplate) {
stream,
c,
cinv,
boutJson,
},
timestamp: Date.now(),
};
if (cache[ID] && Date.now() - cache[ID].timestamp < 3600000) {
var { tj, shorts, stream, c, boutJson } = cache[ID].result;
var { tj, shorts, stream, c } = cache[ID].result;
}
const subscribers = convert(cinv?.subCount || 0);
const about = boutJson?.Channel?.Contents?.ItemSection?.About;
const description = about?.Description.toString().replace(
/\n/g,
" <br> "
@ -349,7 +335,7 @@ module.exports = function (app, config, renderTemplate) {
tab,
shorts,
firstVideo: ChannelFirstVideoObject,
j: boutJson,
j: "",
sort: sort_by,
stream,
tj,