mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-13 03:18:07 +01:00
Update src/libpoketube/init/pages-channel-and-download.js
This commit is contained in:
parent
d449d412f1
commit
40095fe64e
1 changed files with 20 additions and 8 deletions
|
@ -210,8 +210,16 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
|
|
||||||
const tab = req.query.tab;
|
const tab = req.query.tab;
|
||||||
const cache = {};
|
const cache = {};
|
||||||
|
|
||||||
|
try {
|
||||||
|
// about
|
||||||
|
const bout = await fetch(config.tubeApi + `channel?id=${ID}&tab=about`);
|
||||||
|
const h = await bout.text();
|
||||||
|
var boutJson = JSON.parse(modules.toJson(h));
|
||||||
|
} catch {
|
||||||
|
boutJson = " ";
|
||||||
|
}
|
||||||
|
|
||||||
const continuation = req.query.continuation
|
const continuation = req.query.continuation
|
||||||
? `&continuation=${req.query.continuation}`
|
? `&continuation=${req.query.continuation}`
|
||||||
: "";
|
: "";
|
||||||
|
@ -284,19 +292,22 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
stream,
|
stream,
|
||||||
c,
|
c,
|
||||||
cinv,
|
cinv,
|
||||||
|
boutJson,
|
||||||
},
|
},
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (cache[ID] && Date.now() - cache[ID].timestamp < 3600000) {
|
if (cache[ID] && Date.now() - cache[ID].timestamp < 3600000) {
|
||||||
var { tj, shorts, stream, c } = cache[ID].result;
|
var { tj, shorts, stream, c, boutJson } = cache[ID].result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TOBEREMOVED
|
const subscribers = boutJson.Channel?.Metadata.Subscribers;
|
||||||
const subscribers = ""
|
const about = boutJson?.Channel?.Contents?.ItemSection?.About;
|
||||||
const about = ""
|
const description = about?.Description.toString().replace(
|
||||||
const description = ""
|
/\n/g,
|
||||||
const dnoreplace = ""
|
" <br> "
|
||||||
|
);
|
||||||
|
const dnoreplace = about?.Description.toString();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -321,6 +332,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
tab,
|
tab,
|
||||||
shorts,
|
shorts,
|
||||||
firstVideo:ChannelFirstVideoObject,
|
firstVideo:ChannelFirstVideoObject,
|
||||||
|
j: boutJson,
|
||||||
sort: sort_by,
|
sort: sort_by,
|
||||||
stream,
|
stream,
|
||||||
tj,
|
tj,
|
||||||
|
|
Loading…
Reference in a new issue