mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 12:58:25 +01:00
fix channels!!!!!!
This commit is contained in:
parent
2ee0ab3b33
commit
ea288f2de9
1 changed files with 17 additions and 7 deletions
|
@ -18,7 +18,16 @@ const {
|
||||||
getRandomArbitrary,
|
getRandomArbitrary,
|
||||||
} = require("../ptutils/libpt-coreutils.js");
|
} = require("../ptutils/libpt-coreutils.js");
|
||||||
|
|
||||||
const sha384 = modules.hash;
|
const sha384 = modules.hash
|
||||||
|
|
||||||
|
function getJson(str) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(str);
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports = function (app, config, renderTemplate) {
|
module.exports = function (app, config, renderTemplate) {
|
||||||
app.get("/download", async function (req, res) {
|
app.get("/download", async function (req, res) {
|
||||||
|
@ -123,12 +132,12 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//videos
|
//videos
|
||||||
const channel = await modules.fetch(
|
const a = await modules.fetch(`${config.invapi}/channels/videos/${ID}/`).then((res) =>
|
||||||
config.tubeApi +
|
res.text()
|
||||||
`channel?id=${ID}&tab=shorts&Continuation=${continuation}`
|
|
||||||
);
|
);
|
||||||
const c = await channel.text();
|
|
||||||
const tj = JSON.parse(modules.toJson(c));
|
var tj = await getJson(a);
|
||||||
|
|
||||||
|
|
||||||
const summary = await wiki.summary(k.Channel.Metadata.Name);
|
const summary = await wiki.summary(k.Channel.Metadata.Name);
|
||||||
|
|
||||||
|
@ -158,6 +167,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
tab: tab,
|
tab: tab,
|
||||||
j: k,
|
j: k,
|
||||||
tj: tj,
|
tj: tj,
|
||||||
|
turntomins,
|
||||||
dnoreplace: dnoreplace,
|
dnoreplace: dnoreplace,
|
||||||
continuation: continuation,
|
continuation: continuation,
|
||||||
wiki: w,
|
wiki: w,
|
||||||
|
|
Loading…
Reference in a new issue