mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-25 17:48:41 +01:00
Merge pull request 'main' (#3) from ashley/poke:main into main
Reviewed-on: https://codeberg.org/Korbs/poke/pulls/3
This commit is contained in:
commit
43cf7dc468
15 changed files with 442 additions and 369 deletions
25
ascii_txt.txt
Normal file
25
ascii_txt.txt
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
|
||||
_____ _______ _____ _____
|
||||
/\ \ /::\ \ /\ \ /\ \
|
||||
/::\ \ /::::\ \ /::\____\ /::\ \
|
||||
/::::\ \ /::::::\ \ /:::/ / /::::\ \
|
||||
/::::::\ \ /::::::::\ \ /:::/ / /::::::\ \
|
||||
/:::/\:::\ \ /:::/~~\:::\ \ /:::/ / /:::/\:::\ \
|
||||
/:::/__\:::\ \ /:::/ \:::\ \ /:::/____/ /:::/__\:::\ \
|
||||
/::::\ \:::\ \ /:::/ / \:::\ \ /::::\ \ /::::\ \:::\ \
|
||||
/::::::\ \:::\ \ /:::/____/ \:::\____\ /::::::\____\________ /::::::\ \:::\ \
|
||||
/:::/\:::\ \:::\____\ |:::| | |:::| | /:::/\:::::::::::\ \ /:::/\:::\ \:::\ \
|
||||
/:::/ \:::\ \:::| ||:::|____| |:::| |/:::/ |:::::::::::\____\/:::/__\:::\ \:::\____\
|
||||
\::/ \:::\ /:::|____| \:::\ \ /:::/ / \::/ |::|~~~|~~~~~ \:::\ \:::\ \::/ /
|
||||
\/_____/\:::\/:::/ / \:::\ \ /:::/ / \/____|::| | \:::\ \:::\ \/____/
|
||||
\::::::/ / \:::\ /:::/ / |::| | \:::\ \:::\ \
|
||||
\::::/ / \:::\__/:::/ / |::| | \:::\ \:::\____\
|
||||
\::/____/ \::::::::/ / |::| | \:::\ \::/ /
|
||||
~~ \::::::/ / |::| | \:::\ \/____/
|
||||
\::::/ / |::| | \:::\ \
|
||||
\::/____/ \::| | \:::\____\
|
||||
~~ \:| | \::/ /
|
||||
\|___| \/____/
|
||||
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
"invchannel": "https://invid-api.poketube.fun/api/v1",
|
||||
"p_url":"https://p.poketube.fun",
|
||||
"media_proxy": "https://image-proxy.poketube.fun",
|
||||
"videourl":"https://usa-proxy.poketube.fun",
|
||||
"videourl":"https://eu-proxy.poketube.fun",
|
||||
"email_main_url":"https://email-server.poketube.fun",
|
||||
"mastodon_client_url":"https://fediverse.poketube.fun",
|
||||
"libreoffice_online_url":"https://office.poketube.fun",
|
||||
|
|
BIN
css/poke-screnshot-v2.png
Normal file
BIN
css/poke-screnshot-v2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1,020 KiB |
|
@ -731,30 +731,30 @@ a.new-button:hover {
|
|||
display: none;
|
||||
}
|
||||
|
||||
.v:checked ~ .div_box {
|
||||
display: flex;
|
||||
margin-top: -51em;
|
||||
text-align: left;
|
||||
background: #0009;
|
||||
border-radius: 10px;
|
||||
height: fit-content;
|
||||
padding: 10px;
|
||||
font-family: "ubuntu", sans-serif;
|
||||
margin-left: -11em;
|
||||
width: 43em;
|
||||
position: absolute;
|
||||
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
white-space: -webkit-pre-wrap; /* Newer versions of Chrome/Safari*/
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
height: -moz-fit-content;
|
||||
height: -webkit-fit-content;
|
||||
max-width: 708px;
|
||||
max-height: 185.6px;
|
||||
.v:checked~.div_box {
|
||||
display:flex;
|
||||
margin-top:-51em;
|
||||
text-align:left;
|
||||
background:#0009;
|
||||
border-radius:10px;
|
||||
height:fit-content;
|
||||
padding:10px;
|
||||
font-family:ubuntu,sans-serif;
|
||||
width:43em;
|
||||
position:absolute;
|
||||
white-space:-moz-pre-wrap!important;
|
||||
white-space:-pre-wrap;
|
||||
white-space:-o-pre-wrap;
|
||||
white-space:pre-wrap;
|
||||
word-wrap:break-word;
|
||||
white-space:-webkit-pre-wrap;
|
||||
word-break:break-all;
|
||||
white-space:normal;
|
||||
height:-moz-fit-content;
|
||||
height:-webkit-fit-content;
|
||||
max-width:708px;
|
||||
max-height:185.6px;
|
||||
margin-right: 13em;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1400px) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%- include('error.ejs', {
|
||||
error: "404",
|
||||
description: "Very 1984 Innit? I dont think this webpage exist :p"
|
||||
error: "404 ER_ROR",
|
||||
description: "you are in violation. thEy mustn't know you were here. no one should ever find out About this. you can never tell anyone about thiS -- for The sake of the others' survIval, you muSt keep this silent. we mUst keeP silent. no one can know. no one can know. no o ne c an kn ow_ (Violation Code. 15398642_14)"
|
||||
}) %>
|
|
@ -107,7 +107,7 @@
|
|||
|
||||
<img src="/static/poke-chan-outfit-a.png" title="Poke-chan sitting :3">
|
||||
<div style="display: flex; gap: 12px;">
|
||||
<img src="/static/poke-screnshot-a.png" />
|
||||
<img src="/static/poke-screnshot-v2.png" />
|
||||
<img src="/static/Poke-Mobile.jpg" />
|
||||
</div>
|
||||
|
||||
|
|
|
@ -370,12 +370,12 @@ a[data-onclick="jump_to_time"] {
|
|||
</style>
|
||||
|
||||
<!-- css files -->
|
||||
<link href="/css/app-cdn.min.css" rel=stylesheet>
|
||||
<link href="/css/app.main.css?v=44600" rel=stylesheet>
|
||||
<link href="/css/watch.main.css" rel=stylesheet>
|
||||
<link href="/css/watch-util.css" rel=stylesheet>
|
||||
<link href="/css/watch-navbar.css" rel=stylesheet>
|
||||
<link href="/css/poketube.css?v=989344" rel=stylesheet>
|
||||
<link href="/css/app-cdn.min.css?v=9893448" rel=stylesheet>
|
||||
<link href="/css/app.main.css?v=446008" rel=stylesheet>
|
||||
<link href="/css/watch.main.css?v=9893448" rel=stylesheet>
|
||||
<link href="/css/watch-util.css?v=9893448" rel=stylesheet>
|
||||
<link href="/css/watch-navbar.css?v=9893448" rel=stylesheet>
|
||||
<link href="/css/poketube.css?v=98934844" rel=stylesheet>
|
||||
|
||||
<% if (k.Video.Channel.Name == "7clouds") { %>
|
||||
<style>
|
||||
|
@ -395,6 +395,11 @@ a[data-onclick="jump_to_time"] {
|
|||
.auto-play{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.theather {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.progress-container {
|
||||
display:none !important;
|
||||
}
|
||||
|
@ -1061,11 +1066,16 @@ Privacy
|
|||
<input type="checkbox" class="v" id="box" style="display:none">
|
||||
<label class="h" for="box">
|
||||
<div class="fnt">
|
||||
<i title="Stats for nerdys" class="fa-light fa-bug"></i> Stats
|
||||
<% if (Math.floor(Math.random() * 50) === 0) { %>
|
||||
<i title="Stats for nerdys" class="fa-light fa-bug"></i> Stats For Puppies
|
||||
<% } else { %>
|
||||
<i title="Stats for nerdys" class="fa-light fa-bug"></i> Stats For Nerds
|
||||
<% } %>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<a onclick="if(document.querySelector('.watch-page').style.display === 'grid') {document.querySelector('.watch-page').style.display = 'flex'} else {document.querySelector('.watch-page').style.display = 'grid'}"><i class="fa-sharp fa-light fa-up-right-and-down-left-from-center"></i> Theater</a>
|
||||
|
||||
<a onclick="if(document.querySelector('.watch-page').style.display === 'grid') {document.querySelector('.watch-page').style.display = 'flex'} else {document.querySelector('.watch-page').style.display = 'grid'}" class="theather"><i class="fa-sharp fa-light fa-up-right-and-down-left-from-center"></i> Theater</a>
|
||||
|
||||
<% if (inv.comments) { %>
|
||||
<input type="checkbox" class="hj" id="j" style="display:none">
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<link href=/css/yt-ukraine.svg?v=6 rel=icon>
|
||||
<link href=/css/app-cdn.min.css rel=stylesheet>
|
||||
<link href=/css/app.main.css?v=44600 rel=stylesheet>
|
||||
<link href=/css/search.main.css?v=57 rel=stylesheet>
|
||||
<link href=/css/search.main.css?v=547 rel=stylesheet>
|
||||
<link href=/css/watch.main.css rel=stylesheet>
|
||||
<meta name="darkreader-lock"> <!-- tells dark reader that the site has a dark theme and to turn itself off -->
|
||||
<meta content="Searching <%=q%> - Poke" property=og:title>
|
||||
|
|
6
infocards.json
Normal file
6
infocards.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"Open Source":{
|
||||
"infocard":"<i>Open Source</i> is a wrong terminology",
|
||||
"more_info":"https://gnu.org/not-open-source"
|
||||
}
|
||||
}
|
86
server.js
86
server.js
|
@ -32,9 +32,19 @@
|
|||
const media_proxy = require("./src/libpoketube/libpoketube-video.js");
|
||||
const { sinit } = require("./src/libpoketube/init/superinit.js");
|
||||
const innertube = require("./src/libpoketube/libpoketube-youtubei-objects.json");
|
||||
|
||||
const fs = require("fs");
|
||||
const config = require("./config.json");
|
||||
const u = await media_proxy();
|
||||
|
||||
fs.readFile("ascii_txt.txt", "utf8", (err, data) => {
|
||||
if (err) {
|
||||
console.error("Error reading the file:", err);
|
||||
return;
|
||||
}
|
||||
|
||||
// Log the ASCII art to the console
|
||||
console.log(data);
|
||||
});
|
||||
initlog("Loading...");
|
||||
initlog(
|
||||
"[Welcome] Welcome To Poke - The ultimate privacy app - :3 " +
|
||||
|
@ -65,12 +75,11 @@
|
|||
const sha384 = modules.hash;
|
||||
const rateLimit = require("express-rate-limit");
|
||||
|
||||
const limiter = rateLimit({
|
||||
windowMs: 45 * 1000, // 45 Seconds
|
||||
max: 886, // limit each IP to 866 requests per windowMs
|
||||
});
|
||||
|
||||
const limiter = rateLimit({
|
||||
windowMs:45 * 1000, // 45 Seconds
|
||||
max: 886, // limit each IP to 866 requests per windowMs
|
||||
});
|
||||
|
||||
var app = modules.express();
|
||||
app.use(limiter);
|
||||
initlog("Loaded express.js");
|
||||
|
@ -79,7 +88,7 @@
|
|||
app.use(modules.useragent.express());
|
||||
app.use(modules.express.json()); // for parsing application/json
|
||||
app.enable("trust proxy");
|
||||
var toobusy = require('toobusy-js')
|
||||
var toobusy = require("toobusy-js");
|
||||
|
||||
const renderTemplate = async (res, req, template, data = {}) => {
|
||||
res.render(
|
||||
|
@ -87,26 +96,25 @@
|
|||
Object.assign(data)
|
||||
);
|
||||
};
|
||||
|
||||
// Set check interval to a faster value. This will catch more latency spikes
|
||||
// but may cause the check to be too sensitive.
|
||||
toobusy.interval(110);
|
||||
|
||||
toobusy.maxLag(3500);
|
||||
|
||||
app.use(function(req, res, next) {
|
||||
if (toobusy()) {
|
||||
res.send(503, "I'm busy right now, sorry.");
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
toobusy.onLag(function(currentLag) {
|
||||
process.exit(1);
|
||||
console.log("Event loop lag detected! Latency: " + currentLag + "ms");
|
||||
});
|
||||
|
||||
// Set check interval to a faster value. This will catch more latency spikes
|
||||
// but may cause the check to be too sensitive.
|
||||
toobusy.interval(110);
|
||||
|
||||
toobusy.maxLag(3500);
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
if (toobusy()) {
|
||||
res.send(503, "I'm busy right now, sorry.");
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
toobusy.onLag(function (currentLag) {
|
||||
process.exit(1);
|
||||
console.log("Event loop lag detected! Latency: " + currentLag + "ms");
|
||||
});
|
||||
|
||||
const random_words = [
|
||||
"banana pie",
|
||||
|
@ -140,8 +148,8 @@ toobusy.maxLag(3500);
|
|||
res.header("secure-poketube-instance", "1");
|
||||
|
||||
// opt out of googles "FLOC" bullcrap :p See https://spreadprivacy.com/block-floc-with-duckduckgo/
|
||||
res.header("Permissions-Policy", "interest-cohort=()")
|
||||
res.header("software-name", "poke")
|
||||
res.header("Permissions-Policy", "interest-cohort=()");
|
||||
res.header("software-name", "poke");
|
||||
next();
|
||||
});
|
||||
|
||||
|
@ -162,10 +170,22 @@ toobusy.maxLag(3500);
|
|||
});
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
res.header("X-PokeTube-Youtube-Client-Name", innertube.innertube.CONTEXT_CLIENT.INNERTUBE_CONTEXT_CLIENT_NAME);
|
||||
res.header("Hey-there", "Do u wanna help poke? contributons are welcome :3 https://codeberg.org/Ashley/poke")
|
||||
res.header("X-PokeTube-Youtube-Client-Version", innertube.innertube.CLIENT.clientVersion);
|
||||
res.header("X-PokeTube-Client-name", innertube.innertube.CLIENT.projectClientName);
|
||||
res.header(
|
||||
"X-PokeTube-Youtube-Client-Name",
|
||||
innertube.innertube.CONTEXT_CLIENT.INNERTUBE_CONTEXT_CLIENT_NAME
|
||||
);
|
||||
res.header(
|
||||
"Hey-there",
|
||||
"Do u wanna help poke? contributons are welcome :3 https://codeberg.org/Ashley/poke"
|
||||
);
|
||||
res.header(
|
||||
"X-PokeTube-Youtube-Client-Version",
|
||||
innertube.innertube.CLIENT.clientVersion
|
||||
);
|
||||
res.header(
|
||||
"X-PokeTube-Client-name",
|
||||
innertube.innertube.CLIENT.projectClientName
|
||||
);
|
||||
res.header("X-PokeTube-Speeder", "3 seconds no cache, 280ms w/cache");
|
||||
res.header("X-HOSTNAME", req.hostname);
|
||||
if (req.url.match(/^\/(css|js|img|font)\/.+/)) {
|
||||
|
@ -177,7 +197,7 @@ toobusy.maxLag(3500);
|
|||
}
|
||||
|
||||
const a = 890;
|
||||
|
||||
|
||||
if (!req.url.match(/^\/(css|js|img|font)\/.+/)) {
|
||||
res.setHeader("Cache-Control", "public, max-age=" + a); // cache header
|
||||
res.setHeader("poketube-cacher", "PAGE");
|
||||
|
|
|
@ -58,6 +58,7 @@ const splash = [
|
|||
"not done, josh dun!",
|
||||
"your the judge, oh no!",
|
||||
"I dont wanna backslide",
|
||||
"welcome back to trench!",
|
||||
"sai is propaganda!",
|
||||
" •|i|• Ø i+! ].[",
|
||||
"stay alive! |-/",
|
||||
|
|
|
@ -31,13 +31,13 @@ const os = require('os');
|
|||
const cnf = require("../../../config.json");
|
||||
const innertube = require("../libpoketube-youtubei-objects.json");
|
||||
|
||||
const verfull = "v24.2801-JeSsIcA-MAJOR-stable-dev-nonLTS-git-MTcwNjQzMTc0OQ==";
|
||||
const versmol = "v24.2801-JeSsIcA"
|
||||
const verfull = "v24.0605-VeE-MINOR_UPDATE-stable-dev-nonLTS-git-MTcxNTAwOTczNQ==";
|
||||
const versmol = "v24.0605-vEe"
|
||||
const branch = "dev/master";
|
||||
const codename = "jessica";
|
||||
const versionnumber = "273";
|
||||
const relaseunixdate = "MTcwNjQzMTc0OQ=="
|
||||
const updatequote = "Empty your cup so that it may be filled; become devoid to gain totality. - Bruce Lee"
|
||||
const codename = "vee";
|
||||
const versionnumber = "291";
|
||||
const relaseunixdate = "MTcxNTAwOTczNQ=="
|
||||
const updatequote = "Love is the ultimate software update; embrace the patches, for they refine the code of our shared existence, hand in hand, heart to heard (unknown)"
|
||||
|
||||
|
||||
module.exports = function (app, config, renderTemplate) {
|
||||
|
|
|
@ -109,25 +109,27 @@ module.exports = function (app, config, renderTemplate) {
|
|||
const poketube_universe_value = "poketube_smart_search";
|
||||
|
||||
if (query) {
|
||||
let redirectTo = null;
|
||||
let redirectTo = null;
|
||||
let splitParam = ":";
|
||||
|
||||
if (query.includes("youtube.com/watch?v=")) {
|
||||
redirectTo = "/watch?v=";
|
||||
} else if (query.includes("channel:")) {
|
||||
if (query.includes("youtube.com/watch?v=")) {
|
||||
redirectTo = "/watch";
|
||||
splitParam = "?v=";
|
||||
} else if (query.includes("channel:")) {
|
||||
redirectTo = "/channel?id=";
|
||||
} else if (query.includes("video:")) {
|
||||
} else if (query.includes("video:")) {
|
||||
redirectTo = "/watch?v=";
|
||||
}
|
||||
}
|
||||
|
||||
if (redirectTo) {
|
||||
if (redirectTo) {
|
||||
try {
|
||||
const id = query.split(":")[1];
|
||||
res.redirect(`${redirectTo}${id}`);
|
||||
const id = query.split(splitParam)[1];
|
||||
res.redirect(`${redirectTo}${splitParam}${id}`);
|
||||
} catch {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (query && query.startsWith("!") && query.length > 2) {
|
||||
res.redirect("https://lite.duckduckgo.com/lite/?q=" + query);
|
||||
|
@ -229,9 +231,8 @@ module.exports = function (app, config, renderTemplate) {
|
|||
let continuation = req.query.continuation || "";
|
||||
|
||||
try {
|
||||
const results = web.web;
|
||||
|
||||
const results = web.web;
|
||||
|
||||
renderTemplate(res, req, "search-web.ejs", {
|
||||
j: "",
|
||||
IsOldWindows,
|
||||
|
@ -318,7 +319,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
)}/${ID}/?hl=en-US`;
|
||||
|
||||
const channelINVUrl = `${apiUrl}${ID}/`;
|
||||
const checkPronoun = async (id) => (await (await fetch('https://codeberg.org/ashley/poke-pronouns-db/raw/branch/main/pronouns.json')).json())[id] || `no pronouns set`;
|
||||
const checkPronoun = async (id) => (await (await fetch('https://codeberg.org/ashley/poke-pronouns-db/raw/branch/main/pronouns.json')).json())[id] || `no pronouns set`;
|
||||
const pronoun = await checkPronoun(ID);
|
||||
|
||||
var [tj, shorts, playlist, stream, c, cinv] = await Promise.all([
|
||||
|
|
|
@ -141,8 +141,8 @@ function lightOrDark(color) {
|
|||
}
|
||||
|
||||
function isDntEnabled(req) {
|
||||
const dntHeader = req.header('DNT');
|
||||
return dntHeader && (dntHeader === '1' || dntHeader === 'true');
|
||||
const dntHeader = req.header("DNT");
|
||||
return dntHeader && (dntHeader === "1" || dntHeader === "true");
|
||||
}
|
||||
|
||||
function IsInArray(array, id) {
|
||||
|
@ -184,7 +184,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
});
|
||||
|
||||
app.get("/watch", async (req, res) => {
|
||||
const { dm, region, hl, v, e, r, f, m, quality: q, a, universe, } = req.query;
|
||||
const { dm, region, hl, v, e, r, f, m, quality: q, a, universe, } = req.query;
|
||||
|
||||
if (!v) {
|
||||
return res.redirect("/");
|
||||
|
@ -202,153 +202,158 @@ module.exports = function (app, config, renderTemplate) {
|
|||
|
||||
const secure = ["poketube.fun"].includes(req.hostname);
|
||||
const verify = req.hostname === "poketube.sudovanilla.com";
|
||||
|
||||
INNERTUBE.getYouTubeApiVideo(f, v, contentlang, contentregion).then((data) => {
|
||||
try {
|
||||
const k = data?.video;
|
||||
const channel_uploads = data?.channel_uploads
|
||||
const json = data?.json;
|
||||
const engagement = data?.engagement;
|
||||
const inv_comments = data?.comments || "Disabled";
|
||||
const inv_vid = data?.vid;
|
||||
const desc = data?.desc || "";
|
||||
|
||||
let d = false;
|
||||
if (desc !== "[object Object]") {
|
||||
d = desc.toString().replace(/\n/g, " <br> ");
|
||||
}
|
||||
|
||||
|
||||
const descriptionString = String(inv_vid?.description);
|
||||
|
||||
function extractInfo(regex) {
|
||||
return descriptionString !== "[object Object]"
|
||||
? (regex.exec(descriptionString) ?? {}).groups
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const support = extractInfo(PATREON_REGEX);
|
||||
const twitter = extractInfo(X_REGEX);
|
||||
const discord = extractInfo(CORD_REGEX);
|
||||
const twitch = extractInfo(TWITCH_REGEX);
|
||||
const reddit = extractInfo(REDDIT_REGEX);
|
||||
const instagram = extractInfo(INSTAGRAM_REGEX);
|
||||
|
||||
|
||||
var proxyurl = config.p_url;
|
||||
var vidurl = u.url;
|
||||
var isvidious = u.isInvidiousURL;
|
||||
var mediaproxy = config.media_proxy
|
||||
|
||||
|
||||
if (inv_vid?.genre === "Music") {
|
||||
var vidurl = u.losslessurl;
|
||||
}
|
||||
|
||||
var vidurl = config.videourl;
|
||||
var isvidious = true;
|
||||
|
||||
if (req.useragent.source.includes("Pardus")) {
|
||||
var vidurl = "https://iv.ggtyler.dev";
|
||||
var mediaproxy = "https://media-proxy.ashley0143.xyz"
|
||||
var isvidious = true;
|
||||
var isSchoolProxy = "";
|
||||
}
|
||||
|
||||
// unused
|
||||
let badges = "";
|
||||
let comments = "";
|
||||
let nnn = "";
|
||||
|
||||
const dnt_val = isDntEnabled(req)
|
||||
|
||||
if (
|
||||
inv_vid?.error ===
|
||||
"The uploader has not made this video available in your country" ||
|
||||
inv_vid?.error === "This video is not available"
|
||||
) {
|
||||
res.send(
|
||||
"error: " + inv_vid.error + " please refresh the page please qt"
|
||||
);
|
||||
}
|
||||
|
||||
var uaos = req.useragent.os;
|
||||
const browser = req.useragent.browser;
|
||||
const IsOldWindows =
|
||||
(uaos === "Windows 7" || uaos === "Windows 8") &&
|
||||
browser === "Firefox";
|
||||
|
||||
if (uaos === "Windows XP" || uaos === "Windows Vista")
|
||||
res.redirect("/lite?v=" + req.query.v);
|
||||
|
||||
if (req.query.from === "short") var shortsui = true;
|
||||
|
||||
INNERTUBE.getYouTubeApiVideo(f, v, contentlang, contentregion).then(
|
||||
(data) => {
|
||||
try {
|
||||
renderTemplate(res, req, "poketube.ejs", {
|
||||
color: data.color,
|
||||
color2: data.color2,
|
||||
linkify,
|
||||
engagement,
|
||||
IsOldWindows,
|
||||
channelurlfixer,
|
||||
support,
|
||||
shortsui,
|
||||
u: vidurl,
|
||||
isvidious: isvidious,
|
||||
video: json,
|
||||
date: k.Video.uploadDate,
|
||||
e,
|
||||
a,
|
||||
twitter,
|
||||
k,
|
||||
dm,
|
||||
proxyurl,
|
||||
media_proxy_url: mediaproxy,
|
||||
instagram,
|
||||
useragent: req.useragent,
|
||||
verify,
|
||||
discord,
|
||||
turntomins,
|
||||
twitch,
|
||||
dnt_val,
|
||||
reddit,
|
||||
channel_uploads,
|
||||
secure,
|
||||
process,
|
||||
isSchoolProxy,
|
||||
sha384,
|
||||
lightOrDark,
|
||||
isMobile: req.useragent.isMobile,
|
||||
tj: data.channel,
|
||||
r,
|
||||
qua: q,
|
||||
inv: inv_comments,
|
||||
convert,
|
||||
universe,
|
||||
wiki: data.wiki,
|
||||
escapeHtml,
|
||||
f,
|
||||
t: config.t_url,
|
||||
optout: m,
|
||||
badges,
|
||||
desc,
|
||||
comments,
|
||||
n: nnn,
|
||||
inv_vid,
|
||||
lyrics: "",
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
const k = data?.video;
|
||||
const channel_uploads = data?.channel_uploads;
|
||||
const json = data?.json;
|
||||
const engagement = data?.engagement;
|
||||
const inv_comments = data?.comments || "Disabled";
|
||||
const inv_vid = data?.vid;
|
||||
const desc = data?.desc || "";
|
||||
|
||||
let d = false;
|
||||
if (desc !== "[object Object]") {
|
||||
d = desc.toString().replace(/\n/g, " <br> ");
|
||||
}
|
||||
|
||||
const descriptionString = String(inv_vid?.description);
|
||||
|
||||
function extractInfo(regex) {
|
||||
return descriptionString !== "[object Object]"
|
||||
? (regex.exec(descriptionString) ?? {}).groups
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const support = extractInfo(PATREON_REGEX);
|
||||
const twitter = extractInfo(X_REGEX);
|
||||
const discord = extractInfo(CORD_REGEX);
|
||||
const twitch = extractInfo(TWITCH_REGEX);
|
||||
const reddit = extractInfo(REDDIT_REGEX);
|
||||
const instagram = extractInfo(INSTAGRAM_REGEX);
|
||||
|
||||
var proxyurl = config.p_url;
|
||||
var vidurl = u.url;
|
||||
var isvidious = u.isInvidiousURL;
|
||||
var mediaproxy = config.media_proxy;
|
||||
|
||||
if (inv_vid?.genre === "Music") {
|
||||
var vidurl = u.losslessurl;
|
||||
}
|
||||
|
||||
var vidurl = config.videourl;
|
||||
var isvidious = true;
|
||||
|
||||
if (req.useragent.source.includes("Pardus")) {
|
||||
var vidurl = "https://iv.ggtyler.dev";
|
||||
var mediaproxy = "https://nyc1.pokejan.ggtyler.dev/";
|
||||
var isvidious = true;
|
||||
var isSchoolProxy = "";
|
||||
}
|
||||
|
||||
// unused
|
||||
let badges = "";
|
||||
let comments = "";
|
||||
let nnn = "";
|
||||
|
||||
const dnt_val = isDntEnabled(req);
|
||||
|
||||
if (
|
||||
inv_vid?.error ===
|
||||
"The uploader has not made this video available in your country" ||
|
||||
inv_vid?.error === "This video is not available"
|
||||
) {
|
||||
res.send(
|
||||
"error: " + inv_vid.error + " please refresh the page please qt"
|
||||
);
|
||||
}
|
||||
|
||||
if (inv_vid?.error) {
|
||||
renderTemplate(res, req, "404.ejs", {
|
||||
v,
|
||||
});
|
||||
}
|
||||
|
||||
var uaos = req.useragent.os;
|
||||
const browser = req.useragent.browser;
|
||||
const IsOldWindows =
|
||||
(uaos === "Windows 7" || uaos === "Windows 8") &&
|
||||
browser === "Firefox";
|
||||
|
||||
if (uaos === "Windows XP" || uaos === "Windows Vista")
|
||||
res.redirect("/lite?v=" + req.query.v);
|
||||
|
||||
if (req.query.from === "short") var shortsui = true;
|
||||
|
||||
try {
|
||||
renderTemplate(res, req, "poketube.ejs", {
|
||||
color: data.color,
|
||||
color2: data.color2,
|
||||
linkify,
|
||||
engagement,
|
||||
IsOldWindows,
|
||||
channelurlfixer,
|
||||
support,
|
||||
shortsui,
|
||||
u: vidurl,
|
||||
isvidious: isvidious,
|
||||
video: json,
|
||||
date: k.Video.uploadDate,
|
||||
e,
|
||||
a,
|
||||
twitter,
|
||||
k,
|
||||
dm,
|
||||
proxyurl,
|
||||
media_proxy_url: mediaproxy,
|
||||
instagram,
|
||||
useragent: req.useragent,
|
||||
verify,
|
||||
discord,
|
||||
turntomins,
|
||||
twitch,
|
||||
dnt_val,
|
||||
reddit,
|
||||
channel_uploads,
|
||||
secure,
|
||||
process,
|
||||
isSchoolProxy,
|
||||
sha384,
|
||||
lightOrDark,
|
||||
isMobile: req.useragent.isMobile,
|
||||
tj: data.channel,
|
||||
r,
|
||||
qua: q,
|
||||
inv: inv_comments,
|
||||
convert,
|
||||
universe,
|
||||
wiki: data.wiki,
|
||||
escapeHtml,
|
||||
f,
|
||||
t: config.t_url,
|
||||
optout: m,
|
||||
badges,
|
||||
desc,
|
||||
comments,
|
||||
n: nnn,
|
||||
inv_vid,
|
||||
lyrics: "",
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return res.redirect(`/watch?v=${req.query.v}&fx=1&err=${error}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return res.redirect(`/watch?v=${req.query.v}&fx=1&err=${error}`);
|
||||
}
|
||||
});
|
||||
);
|
||||
});
|
||||
|
||||
app.get("/lite", async (req, res) => {
|
||||
const { dm, region, hl, v, e, r, f, m, quality: q, a, universe, } = req.query;
|
||||
const { dm, region, hl, v, e, r, f, m, quality: q, a, universe, } = req.query;
|
||||
|
||||
if (!v) {
|
||||
return res.redirect("/");
|
||||
|
@ -366,145 +371,144 @@ module.exports = function (app, config, renderTemplate) {
|
|||
|
||||
const secure = ["poketube.fun"].includes(req.hostname);
|
||||
const verify = req.hostname === "poketube.sudovanilla.com";
|
||||
|
||||
INNERTUBE.getYouTubeApiVideo(f, v, contentlang, contentregion).then((data) => {
|
||||
try {
|
||||
const k = data?.video;
|
||||
const channel_uploads = data?.channel_uploads
|
||||
const json = data?.json;
|
||||
const engagement = data?.engagement;
|
||||
const inv_comments = data?.comments || "Disabled";
|
||||
const inv_vid = data?.vid;
|
||||
const desc = data?.desc || "";
|
||||
|
||||
let d = false;
|
||||
if (desc !== "[object Object]") {
|
||||
d = desc.toString().replace(/\n/g, " <br> ");
|
||||
}
|
||||
|
||||
|
||||
const descriptionString = String(inv_vid?.description);
|
||||
|
||||
function extractInfo(regex) {
|
||||
return descriptionString !== "[object Object]"
|
||||
? (regex.exec(descriptionString) ?? {}).groups
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const support = extractInfo(PATREON_REGEX);
|
||||
const twitter = extractInfo(X_REGEX);
|
||||
const discord = extractInfo(CORD_REGEX);
|
||||
const twitch = extractInfo(TWITCH_REGEX);
|
||||
const reddit = extractInfo(REDDIT_REGEX);
|
||||
const instagram = extractInfo(INSTAGRAM_REGEX);
|
||||
|
||||
|
||||
var proxyurl = config.p_url;
|
||||
var vidurl = u.url;
|
||||
var isvidious = u.isInvidiousURL;
|
||||
var mediaproxy = config.media_proxy
|
||||
|
||||
|
||||
if (inv_vid?.genre === "Music") {
|
||||
var vidurl = u.losslessurl;
|
||||
}
|
||||
|
||||
var vidurl = "https://eu-proxy.poketube.fun";
|
||||
var isvidious = true;
|
||||
|
||||
if (req.useragent.source.includes("Pardus")) {
|
||||
var vidurl = "https://iv.ggtyler.dev";
|
||||
var mediaproxy = "https://media-proxy.ashley0143.xyz"
|
||||
var isvidious = true;
|
||||
var isSchoolProxy = "";
|
||||
}
|
||||
|
||||
// unused
|
||||
let badges = "";
|
||||
let comments = "";
|
||||
let nnn = "";
|
||||
|
||||
const dnt_val = isDntEnabled(req)
|
||||
|
||||
if (
|
||||
inv_vid?.error ===
|
||||
"The uploader has not made this video available in your country" ||
|
||||
inv_vid?.error === "This video is not available"
|
||||
) {
|
||||
res.send(
|
||||
"error: " + inv_vid.error + " please refresh the page please qt"
|
||||
);
|
||||
}
|
||||
|
||||
var uaos = req.useragent.os;
|
||||
const browser = req.useragent.browser;
|
||||
const IsOldWindows =
|
||||
(uaos === "Windows 7" || uaos === "Windows 8") &&
|
||||
browser === "Firefox";
|
||||
|
||||
if (req.query.from === "short") var shortsui = true;
|
||||
|
||||
INNERTUBE.getYouTubeApiVideo(f, v, contentlang, contentregion).then(
|
||||
(data) => {
|
||||
try {
|
||||
renderTemplate(res, req, "lite.ejs", {
|
||||
color: data.color,
|
||||
color2: data.color2,
|
||||
linkify,
|
||||
engagement,
|
||||
IsOldWindows,
|
||||
channelurlfixer,
|
||||
support,
|
||||
shortsui,
|
||||
u: vidurl,
|
||||
isvidious: isvidious,
|
||||
video: json,
|
||||
date: k.Video.uploadDate,
|
||||
e,
|
||||
a,
|
||||
twitter,
|
||||
k,
|
||||
dm,
|
||||
proxyurl,
|
||||
media_proxy_url: mediaproxy,
|
||||
instagram,
|
||||
useragent: req.useragent,
|
||||
verify,
|
||||
discord,
|
||||
turntomins,
|
||||
twitch,
|
||||
dnt_val,
|
||||
reddit,
|
||||
channel_uploads,
|
||||
secure,
|
||||
process,
|
||||
isSchoolProxy,
|
||||
sha384,
|
||||
lightOrDark,
|
||||
isMobile: req.useragent.isMobile,
|
||||
tj: data.channel,
|
||||
r,
|
||||
qua: q,
|
||||
inv: inv_comments,
|
||||
convert,
|
||||
universe,
|
||||
wiki: data.wiki,
|
||||
f,
|
||||
t: config.t_url,
|
||||
optout: m,
|
||||
badges,
|
||||
desc,
|
||||
comments,
|
||||
n: nnn,
|
||||
inv_vid,
|
||||
lyrics: "",
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
const k = data?.video;
|
||||
const channel_uploads = data?.channel_uploads;
|
||||
const json = data?.json;
|
||||
const engagement = data?.engagement;
|
||||
const inv_comments = data?.comments || "Disabled";
|
||||
const inv_vid = data?.vid;
|
||||
const desc = data?.desc || "";
|
||||
|
||||
let d = false;
|
||||
if (desc !== "[object Object]") {
|
||||
d = desc.toString().replace(/\n/g, " <br> ");
|
||||
}
|
||||
|
||||
const descriptionString = String(inv_vid?.description);
|
||||
|
||||
function extractInfo(regex) {
|
||||
return descriptionString !== "[object Object]"
|
||||
? (regex.exec(descriptionString) ?? {}).groups
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const support = extractInfo(PATREON_REGEX);
|
||||
const twitter = extractInfo(X_REGEX);
|
||||
const discord = extractInfo(CORD_REGEX);
|
||||
const twitch = extractInfo(TWITCH_REGEX);
|
||||
const reddit = extractInfo(REDDIT_REGEX);
|
||||
const instagram = extractInfo(INSTAGRAM_REGEX);
|
||||
|
||||
var proxyurl = config.p_url;
|
||||
var vidurl = u.url;
|
||||
var isvidious = u.isInvidiousURL;
|
||||
var mediaproxy = config.media_proxy;
|
||||
|
||||
if (inv_vid?.genre === "Music") {
|
||||
var vidurl = u.losslessurl;
|
||||
}
|
||||
|
||||
var vidurl = "https://eu-proxy.poketube.fun";
|
||||
var isvidious = true;
|
||||
|
||||
if (req.useragent.source.includes("Pardus")) {
|
||||
var vidurl = "https://iv.ggtyler.dev";
|
||||
var mediaproxy = "https://media-proxy.ashley0143.xyz";
|
||||
var isvidious = true;
|
||||
var isSchoolProxy = "";
|
||||
}
|
||||
|
||||
// unused
|
||||
let badges = "";
|
||||
let comments = "";
|
||||
let nnn = "";
|
||||
|
||||
const dnt_val = isDntEnabled(req);
|
||||
|
||||
if (
|
||||
inv_vid?.error ===
|
||||
"The uploader has not made this video available in your country" ||
|
||||
inv_vid?.error === "This video is not available"
|
||||
) {
|
||||
res.send(
|
||||
"error: " + inv_vid.error + " please refresh the page please qt"
|
||||
);
|
||||
}
|
||||
|
||||
var uaos = req.useragent.os;
|
||||
const browser = req.useragent.browser;
|
||||
const IsOldWindows =
|
||||
(uaos === "Windows 7" || uaos === "Windows 8") &&
|
||||
browser === "Firefox";
|
||||
|
||||
if (req.query.from === "short") var shortsui = true;
|
||||
|
||||
try {
|
||||
renderTemplate(res, req, "lite.ejs", {
|
||||
color: data.color,
|
||||
color2: data.color2,
|
||||
linkify,
|
||||
engagement,
|
||||
IsOldWindows,
|
||||
channelurlfixer,
|
||||
support,
|
||||
shortsui,
|
||||
u: vidurl,
|
||||
isvidious: isvidious,
|
||||
video: json,
|
||||
date: k.Video.uploadDate,
|
||||
e,
|
||||
a,
|
||||
twitter,
|
||||
k,
|
||||
dm,
|
||||
proxyurl,
|
||||
media_proxy_url: mediaproxy,
|
||||
instagram,
|
||||
useragent: req.useragent,
|
||||
verify,
|
||||
discord,
|
||||
turntomins,
|
||||
twitch,
|
||||
dnt_val,
|
||||
reddit,
|
||||
channel_uploads,
|
||||
secure,
|
||||
process,
|
||||
isSchoolProxy,
|
||||
sha384,
|
||||
lightOrDark,
|
||||
isMobile: req.useragent.isMobile,
|
||||
tj: data.channel,
|
||||
r,
|
||||
qua: q,
|
||||
inv: inv_comments,
|
||||
convert,
|
||||
universe,
|
||||
wiki: data.wiki,
|
||||
f,
|
||||
t: config.t_url,
|
||||
optout: m,
|
||||
badges,
|
||||
desc,
|
||||
comments,
|
||||
n: nnn,
|
||||
inv_vid,
|
||||
lyrics: "",
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return res.redirect(`/watch?v=${req.query.v}&fx=1&err=${error}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return res.redirect(`/watch?v=${req.query.v}&fx=1&err=${error}`);
|
||||
}
|
||||
});
|
||||
);
|
||||
});
|
||||
|
||||
app.get("/music", async function (req, res) {
|
||||
|
@ -655,4 +659,4 @@ module.exports = function (app, config, renderTemplate) {
|
|||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
|
@ -30,7 +30,13 @@ class InnerTubePokeVidious {
|
|||
this.config = config;
|
||||
this.cache = {};
|
||||
this.language = "hl=en-US";
|
||||
this.param = "2AMB"
|
||||
this.param_legacy = "CgIIAdgDAQ%3D%3D"
|
||||
this.apikey = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"
|
||||
this.ANDROID_API_KEY = "AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w"
|
||||
this.ANDROID_APP_VERSION = "19.14.42"
|
||||
this.ANDROID_VERSION = "13"
|
||||
this.useragent = "com.google.android.youtube/19.14.42 (Linux; U; Android 12; US) gzip"
|
||||
this.INNERTUBE_CONTEXT_CLIENT_VERSION = "1"
|
||||
this.region = "region=US";
|
||||
this.sqp = "-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw";
|
||||
|
|
Loading…
Reference in a new issue