mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-29 16:08:53 +01:00
REFACTOR THE CODEEE BABYYY LESS GOO
This commit is contained in:
parent
cfccd4417a
commit
98d89a063d
1 changed files with 18 additions and 48 deletions
|
@ -92,6 +92,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
|
||||
h = " ";
|
||||
|
||||
// YOUTUBE WHY do you WANT me to do this oh ma gosh
|
||||
if (j.Search) {
|
||||
if ("Results.DynamicItem" in j.Search) {
|
||||
if (j.Search.Results.DynamicItem.id == "didYouMeanRenderer") {
|
||||
|
@ -134,57 +135,26 @@ module.exports = function (app, config, renderTemplate) {
|
|||
k = " ";
|
||||
}
|
||||
|
||||
if (req.query.continuation) {
|
||||
var continuation = `&continuation=${req.query.continuation}`;
|
||||
}
|
||||
// continuation stuff - whoa cool
|
||||
let continuation = req.query.continuation ? `&continuation=${req.query.continuation}` : "";
|
||||
let continuationl = req.query.continuationl ? `&continuation=${req.query.continuationl}` : "";
|
||||
let continuations = req.query.continuations ? `&continuation=${req.query.continuations}` : "";
|
||||
|
||||
if (!req.query.continuation) {
|
||||
var continuation = "";
|
||||
}
|
||||
// videos - i dont think this is readable at all but o welp if it works it works:tm:
|
||||
// https://github.com/iv-org/invidious/blob/05258d56bdc3f4de1f0da0c0dbd2d540f68cbdd5/src/invidious/channels/videos.cr
|
||||
|
||||
try {
|
||||
//videos
|
||||
const a = await modules
|
||||
.fetch(`https://inv.zzls.xyz/api/v1/channels/videos/${ID}/?sort_by=${req.query.sort_by || "newest"}` + continuation)
|
||||
.then((res) => res.text());
|
||||
const tj = await modules.fetch(`https://inv.zzls.xyz/api/v1/channels/videos/${ID}/?sort_by=${req.query.sort_by || "newest"}` + continuation).then((res) => res.text()).then((txt) => getJson(txt)).catch(" ")
|
||||
const shorts = await modules.fetch(`https://inv.zzls.xyz/api/v1/channels/${ID}/shorts?sort_by=${req.query.sort_by || "newest"}` + continuations).then((res) => res.text()).then((txt) => getJson(txt)).catch(" ")
|
||||
const stream = await modules.fetch(`https://inv.zzls.xyz/api/v1/channels/${ID}/streams?sort_by=${req.query.sort_by || "newest"}` + continuationl).then((res) => res.text()).then((txt) => getJson(txt)).catch(" ")
|
||||
|
||||
var tj = await getJson(a);
|
||||
} catch {
|
||||
var tj = " "
|
||||
}
|
||||
|
||||
try {
|
||||
//videos
|
||||
const b = await modules
|
||||
.fetch(`https://inv.zzls.xyz/api/v1/channels/${ID}/shorts?sort_by=${req.query.sort_by || "newest"}` + continuation)
|
||||
.then((res) => res.text());
|
||||
|
||||
var shorts = await getJson(b);
|
||||
} catch {
|
||||
var shorts = " "
|
||||
}
|
||||
|
||||
try {
|
||||
//videos
|
||||
const c = await modules
|
||||
.fetch(`https://inv.zzls.xyz/api/v1/channels/${ID}/streams?sort_by=${req.query.sort_by || "newest"}` + continuation)
|
||||
.then((res) => res.text());
|
||||
|
||||
var stream = await getJson(c);
|
||||
} catch {
|
||||
var stream = " "
|
||||
}
|
||||
|
||||
const community = await modules
|
||||
.fetch(`https://inv.zzls.xyz/api/v1/channels/community/${ID}/`)
|
||||
.then((res) => res.text());
|
||||
|
||||
var c = await getJson(community);
|
||||
// community tab - protobuf Egljb21tdW5pdHk%3D
|
||||
const c = await modules.fetch(`https://inv.zzls.xyz/api/v1/channels/community/${ID}/`).then((res) => res.text()) .then((txt) => getJson(txt));
|
||||
|
||||
try {
|
||||
const summary = await wiki.summary(k.Channel.Metadata.Name);
|
||||
|
||||
var w = "";
|
||||
|
||||
if (summary.title === "Not found.") {
|
||||
w = "none";
|
||||
}
|
||||
|
@ -227,7 +197,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
subs:
|
||||
typeof subscribers === "string"
|
||||
? subscribers.replace("subscribers", "")
|
||||
: "Private",
|
||||
: "None",
|
||||
desc: d,
|
||||
});
|
||||
} catch {
|
||||
|
|
Loading…
Reference in a new issue