mirror of
https://codeberg.org/ashley/poke
synced 2025-06-03 04:59:41 +00:00
p2
This commit is contained in:
parent
7188bfdf03
commit
4b33b38e1f
@ -23,118 +23,114 @@ var ping = require("ping");
|
|||||||
|
|
||||||
const sha384 = modules.hash;
|
const sha384 = modules.hash;
|
||||||
|
|
||||||
|
|
||||||
const splash = [
|
const splash = [
|
||||||
"Woke!",
|
"Woke!",
|
||||||
"Gay gay homosexaul gay!",
|
"Gay gay homosexaul gay!",
|
||||||
"free Palestine!",
|
"free Palestine!",
|
||||||
"free software!",
|
"free software!",
|
||||||
"im... stuff!",
|
"im... stuff!",
|
||||||
"frick capitalism!",
|
"frick capitalism!",
|
||||||
"still calling it twitter btw!",
|
"still calling it twitter btw!",
|
||||||
"boop!",
|
"boop!",
|
||||||
"no way!",
|
"no way!",
|
||||||
"traaaa rightssss!",
|
"traaaa rightssss!",
|
||||||
"XD!",
|
"XD!",
|
||||||
"nya!",
|
"nya!",
|
||||||
"say gex!",
|
"say gex!",
|
||||||
"ur valid :3",
|
"ur valid :3",
|
||||||
"gay space communism!",
|
"gay space communism!",
|
||||||
"doesnt have AI!",
|
"doesnt have AI!",
|
||||||
"no web3!",
|
"no web3!",
|
||||||
"keemstar is a bald ___!",
|
"keemstar is a bald ___!",
|
||||||
"No One calls it 'X'! ",
|
"No One calls it 'X'! ",
|
||||||
"Eat the rich!",
|
"Eat the rich!",
|
||||||
"Does Not include Nazis!",
|
"Does Not include Nazis!",
|
||||||
"also try piped!",
|
"also try piped!",
|
||||||
"not alt-right!",
|
"not alt-right!",
|
||||||
"coke zero > coke classic!",
|
"coke zero > coke classic!",
|
||||||
"poke & chill!",
|
"poke & chill!",
|
||||||
"can play HD!",
|
"can play HD!",
|
||||||
"also try invidious!",
|
"also try invidious!",
|
||||||
"also try vencord!",
|
"also try vencord!",
|
||||||
"rms <3!",
|
"rms <3!",
|
||||||
"du hast",
|
"du hast",
|
||||||
"can u belive no one bought this?",
|
"can u belive no one bought this?",
|
||||||
"reee",
|
"reee",
|
||||||
"1.000.000€!",
|
"1.000.000€!",
|
||||||
"pika!",
|
"pika!",
|
||||||
"fsf.org",
|
"fsf.org",
|
||||||
"ssfffssfssfffaassssfsdf!",
|
"ssfffssfssfffaassssfsdf!",
|
||||||
"𝓯𝓻𝓮𝓪𝓴𝔂poke",
|
"𝓯𝓻𝓮𝓪𝓴𝔂poke",
|
||||||
"they not like us!",
|
"they not like us!",
|
||||||
"to pimp a butterfly!",
|
"to pimp a butterfly!",
|
||||||
"king kunta!",
|
"king kunta!",
|
||||||
"HUMBLE.",
|
"HUMBLE.",
|
||||||
"can you save my hds?",
|
"can you save my hds?",
|
||||||
"sahlo folina!",
|
"sahlo folina!",
|
||||||
"we come for you!",
|
"we come for you!",
|
||||||
"no chances!",
|
"no chances!",
|
||||||
"dema dont control us!",
|
"dema dont control us!",
|
||||||
"i see your problem is, your proctologist",
|
"i see your problem is, your proctologist",
|
||||||
"got both hands on your shoulder",
|
"got both hands on your shoulder",
|
||||||
"while ur bottomless!",
|
"while ur bottomless!",
|
||||||
"you should bounce bounce bounce man!",
|
"you should bounce bounce bounce man!",
|
||||||
"its lavish!",
|
"its lavish!",
|
||||||
"im vibin, vibin!",
|
"im vibin, vibin!",
|
||||||
"i would swim the paladin strait",
|
"i would swim the paladin strait",
|
||||||
"hello clancy!",
|
"hello clancy!",
|
||||||
"NO NOT ME,ITS FOR A FRIEND",
|
"NO NOT ME,ITS FOR A FRIEND",
|
||||||
"im fairly local!",
|
"im fairly local!",
|
||||||
"i dont wanna go like this!",
|
"i dont wanna go like this!",
|
||||||
"east is up!",
|
"east is up!",
|
||||||
"not done, josh dun!",
|
"not done, josh dun!",
|
||||||
"your the judge, oh no!",
|
"your the judge, oh no!",
|
||||||
"I dont wanna backslide",
|
"I dont wanna backslide",
|
||||||
"welcome back to trench!",
|
"welcome back to trench!",
|
||||||
"sai is propaganda!",
|
"sai is propaganda!",
|
||||||
" •|i|• Ø i+! ].[",
|
" •|i|• Ø i+! ].[",
|
||||||
"stay alive! |-/",
|
"stay alive! |-/",
|
||||||
"the few, the proud, the Emotional!",
|
"the few, the proud, the Emotional!",
|
||||||
"ill morph into someone else",
|
"ill morph into someone else",
|
||||||
"still alive",
|
"still alive",
|
||||||
"follow the torches",
|
"follow the torches",
|
||||||
"i created this world!",
|
"i created this world!",
|
||||||
"to feel some control!",
|
"to feel some control!",
|
||||||
"destory it if i want!",
|
"destory it if i want!",
|
||||||
"o7 keons",
|
"o7 keons",
|
||||||
"at least let me clean my room",
|
"at least let me clean my room",
|
||||||
"100+ stars on gh!",
|
"100+ stars on gh!",
|
||||||
"let the vibe slide over me!",
|
"let the vibe slide over me!",
|
||||||
"sip a capri sun like its don peregon",
|
"sip a capri sun like its don peregon",
|
||||||
"now even gayer!",
|
"now even gayer!",
|
||||||
"its joever..",
|
"its joever..",
|
||||||
"lesbiam,,,",
|
"lesbiam,,,",
|
||||||
"poke!!!",
|
"poke!!!",
|
||||||
"discord.poketube.fun!",
|
"discord.poketube.fun!",
|
||||||
"women are pretty!",
|
"women are pretty!",
|
||||||
"men are handsome!",
|
"men are handsome!",
|
||||||
"enbys are cute!",
|
"enbys are cute!",
|
||||||
"you are cute :3",
|
"you are cute :3",
|
||||||
"read if cute!",
|
"read if cute!",
|
||||||
"this shit awesome!",
|
"this shit awesome!",
|
||||||
"ur pawsome!",
|
"ur pawsome!",
|
||||||
"meows at u",
|
"meows at u",
|
||||||
"hai i am gay",
|
"hai i am gay",
|
||||||
"yay, GEX!",
|
"yay, GEX!",
|
||||||
"say gex..,,",
|
"say gex..,,",
|
||||||
"wha if we um erm",
|
"wha if we um erm",
|
||||||
"turkey is literally 1984!",
|
"turkey is literally 1984!",
|
||||||
"turkey is literally 1984!",
|
"turkey is literally 1984!",
|
||||||
"turkey is literally 1984!",
|
"turkey is literally 1984!",
|
||||||
"turkey is literally 1984!",
|
"turkey is literally 1984!",
|
||||||
"turkey is literally 1984!",
|
"turkey is literally 1984!",
|
||||||
"turkey is literally 1984!",
|
"turkey is literally 1984!",
|
||||||
"awesome screen!",
|
"awesome screen!",
|
||||||
"awesome camera!",
|
"awesome camera!",
|
||||||
"long lasting battery life",
|
"long lasting battery life",
|
||||||
"stallmansupport.org!!!",
|
"stallmansupport.org!!!",
|
||||||
"does include nya~!!!",
|
"does include nya~!!!",
|
||||||
"actually stable! :3",
|
"actually stable! :3",
|
||||||
]
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getJson(str) {
|
function getJson(str) {
|
||||||
try {
|
try {
|
||||||
@ -146,20 +142,23 @@ function getJson(str) {
|
|||||||
|
|
||||||
module.exports = function (app, config, renderTemplate) {
|
module.exports = function (app, config, renderTemplate) {
|
||||||
app.get("/app", async function (req, res) {
|
app.get("/app", async function (req, res) {
|
||||||
const { fetch } = await import("undici");
|
const { fetch } = await import("undici");
|
||||||
|
|
||||||
let tab = "";
|
let tab = "";
|
||||||
if (req.query.tab) {
|
if (req.query.tab) {
|
||||||
tab = `/?type=${capitalizeFirstLetter(req.query.tab)}`;
|
tab = `/?type=${capitalizeFirstLetter(req.query.tab)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const invtrend = await fetch(
|
const invtrend = await fetch(`${config.invapi}/trending${tab}`, {
|
||||||
`${config.invapi}/trending${tab}`
|
headers: { "User-Agent": config.useragent },
|
||||||
);
|
});
|
||||||
const t = getJson(await invtrend.text());
|
const t = getJson(await invtrend.text());
|
||||||
|
|
||||||
const invpopular = await fetch(
|
const invpopular = await fetch(
|
||||||
`https://invid-api.poketube.fun/bHj665PpYhUdPWuKPfZuQGoX/api/v1/popular`
|
`https://invid-api.poketube.fun/bHj665PpYhUdPWuKPfZuQGoX/api/v1/popular`,
|
||||||
|
{
|
||||||
|
headers: { "User-Agent": config.useragent },
|
||||||
|
}
|
||||||
);
|
);
|
||||||
const p = getJson(await invpopular.text());
|
const p = getJson(await invpopular.text());
|
||||||
|
|
||||||
@ -190,18 +189,15 @@ module.exports = function (app, config, renderTemplate) {
|
|||||||
const uaos = req.useragent.os;
|
const uaos = req.useragent.os;
|
||||||
const random = splash[Math.floor(Math.random() * splash.length)];
|
const random = splash[Math.floor(Math.random() * splash.length)];
|
||||||
const browser = req.useragent.browser;
|
const browser = req.useragent.browser;
|
||||||
const isOldWindows = (uaos === "Windows 7" || uaos === "Windows 8") && browser === "Firefox";
|
const isOldWindows =
|
||||||
|
(uaos === "Windows 7" || uaos === "Windows 8") &&
|
||||||
|
browser === "Firefox";
|
||||||
var proxyurl = config.p_url;
|
var proxyurl = config.p_url;
|
||||||
|
|
||||||
const secure = [
|
const secure = ["poketube.fun", "localhost"].includes(req.hostname);
|
||||||
"poketube.fun",
|
const verify = ["poketube.fun", "poke.ashley0143.xyz", "localhost"].includes(
|
||||||
"localhost" //
|
req.hostname
|
||||||
].includes(req.hostname);
|
);
|
||||||
const verify = [
|
|
||||||
"poketube.fun",
|
|
||||||
"poke.ashley0143.xyz",
|
|
||||||
"localhost"
|
|
||||||
].includes(req.hostname);
|
|
||||||
|
|
||||||
const rendermainpage = () => {
|
const rendermainpage = () => {
|
||||||
if (req.useragent.isMobile) {
|
if (req.useragent.isMobile) {
|
||||||
@ -210,13 +206,13 @@ module.exports = function (app, config, renderTemplate) {
|
|||||||
|
|
||||||
return renderTemplate(res, req, "landing.ejs", {
|
return renderTemplate(res, req, "landing.ejs", {
|
||||||
secure,
|
secure,
|
||||||
embedtype:req.query.embedtype,
|
embedtype: req.query.embedtype,
|
||||||
banner:config.banner,
|
banner: config.banner,
|
||||||
DisablePokeChan:req.query.DisablePokeChan,
|
DisablePokeChan: req.query.DisablePokeChan,
|
||||||
verify,
|
verify,
|
||||||
isOldWindows,
|
isOldWindows,
|
||||||
proxyurl,
|
proxyurl,
|
||||||
random
|
random,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -225,14 +221,14 @@ module.exports = function (app, config, renderTemplate) {
|
|||||||
if (isvld && req.params.v.length >= 10) {
|
if (isvld && req.params.v.length >= 10) {
|
||||||
return res.redirect(`/watch?v=${req.params.v}`);
|
return res.redirect(`/watch?v=${req.params.v}`);
|
||||||
} else {
|
} else {
|
||||||
res.status(404)
|
res.status(404);
|
||||||
return renderTemplate(res, req, "404.ejs", {
|
return renderTemplate(res, req, "404.ejs", {
|
||||||
isOldWindows,
|
isOldWindows,
|
||||||
random
|
random,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rendermainpage();
|
return rendermainpage();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user