mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-29 18:08:47 +01:00
fix channels!!!!!!
This commit is contained in:
parent
89c7a196fc
commit
77ede5cc78
1 changed files with 31 additions and 8 deletions
|
@ -122,24 +122,47 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
boutJson = " ";
|
boutJson = " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
const continuation = req.query.continuation || "";
|
const continuation = req.query.continuation
|
||||||
const continuationl = req.query.continuationl || "";
|
? `&continuation=${req.query.continuation}`
|
||||||
const continuations = req.query.continuations || "";
|
: "";
|
||||||
|
const continuationl = req.query.continuationl
|
||||||
|
? `&continuation=${req.query.continuationl}`
|
||||||
|
: "";
|
||||||
|
const continuations = req.query.continuations
|
||||||
|
? `&continuation=${req.query.continuations}`
|
||||||
|
: "";
|
||||||
const sort_by = req.query.sort_by || "newest";
|
const sort_by = req.query.sort_by || "newest";
|
||||||
|
|
||||||
const getChannelData = async (url) => {
|
const getChannelData = async (url) => {
|
||||||
try {
|
try {
|
||||||
return await modules.fetch(url).then((res) => res.text()).then((txt) => getJson(txt));
|
return await modules
|
||||||
|
.fetch(url)
|
||||||
|
.then((res) => res.text())
|
||||||
|
.then((txt) => getJson(txt));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch channel data from API:", error);
|
console.error("Failed to fetch channel data from API:", error);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const tj = await getChannelData(`https://invid-api.poketube.fun/api/v1/channels/videos/${ID}/?sort_by=${req.query.sort_by || "newest"}` + `&continuation=${continuation}` );
|
const tj = await getChannelData(
|
||||||
const shorts = await getChannelData(`https://invid-api.poketube.fun/api/v1/channels/${ID}/shorts?sort_by=${req.query.sort_by || "newest"}` + `&continuation=${continuations}` );
|
`https://invid-api.poketube.fun/api/v1/channels/videos/${ID}/?sort_by=${
|
||||||
const stream = await getChannelData(`https://invid-api.poketube.fun/api/v1/channels/${ID}/streams?sort_by=${ req.query.sort_by || "newest"}` + + `&continuation=${continuationl}`);
|
req.query.sort_by || "newest"
|
||||||
const c = await getChannelData(`https://invid-api.poketube.fun/api/v1/channels/community/${ID}/`);
|
}${continuation}`
|
||||||
|
);
|
||||||
|
const shorts = await getChannelData(
|
||||||
|
`https://invid-api.poketube.fun/api/v1/channels/${ID}/shorts?sort_by=${
|
||||||
|
req.query.sort_by || "newest"
|
||||||
|
}${continuations}`
|
||||||
|
);
|
||||||
|
const stream = await getChannelData(
|
||||||
|
`https://invid-api.poketube.fun/api/v1/channels/${ID}/streams?sort_by=${
|
||||||
|
req.query.sort_by || "newest"
|
||||||
|
}${continuationl}`
|
||||||
|
);
|
||||||
|
const c = await getChannelData(
|
||||||
|
`https://invid-api.poketube.fun/api/v1/channels/community/${ID}/`
|
||||||
|
);
|
||||||
|
|
||||||
const summary = await wiki.summary(boutJson.Channel.Metadata.Name);
|
const summary = await wiki.summary(boutJson.Channel.Metadata.Name);
|
||||||
const wikiSummary = summary.title !== "Not found." ? summary : "none";
|
const wikiSummary = summary.title !== "Not found." ? summary : "none";
|
||||||
|
|
Loading…
Reference in a new issue