add poke atmos :3

This commit is contained in:
Ashley 2023-02-15 17:27:32 +00:00
parent 7b4842fe92
commit 844c526a6b

View file

@ -18,6 +18,7 @@ const {
getRandomArbitrary, getRandomArbitrary,
} = require("../ptutils/libpt-coreutils.js"); } = require("../ptutils/libpt-coreutils.js");
const media_proxy = require("../libpoketube-video.js"); const media_proxy = require("../libpoketube-video.js");
const atmos = require("../../../pokeatmosurls.json");
const sha384 = modules.hash; const sha384 = modules.hash;
const fetch = modules.fetch; const fetch = modules.fetch;
@ -68,6 +69,12 @@ async function lyricsFinder(e = "", d = "") {
return String(encoding.convert(final)).trim(); return String(encoding.convert(final)).trim();
} }
function toObject(arr) {
var rv = {};
for (var i = 0; i < arr.length; ++i) if (arr[i] !== undefined) rv[i] = arr[i];
return rv;
}
function lightOrDark(color) { function lightOrDark(color) {
// Variables for red, green, blue values // Variables for red, green, blue values
var r, g, b, hsp; var r, g, b, hsp;
@ -433,11 +440,15 @@ module.exports = function (app, config, renderTemplate) {
res.redirect(`/watch?v=${v}`); res.redirect(`/watch?v=${v}`);
} }
if (req.useragent.isMobile) {
res.redirect(`/watch?v=${v}`);
}
//video //video
var url = `https://tube.kuylar.dev/proxy/media/${v}/22`; var url = `https://tube.kuylar.dev/proxy/media/${v}/22`;
// encryption // encryption
const url_e = var url_e =
url + url +
"?e=" + "?e=" +
sha384(k.Video.Channel.id) + sha384(k.Video.Channel.id) +
@ -445,6 +456,23 @@ module.exports = function (app, config, renderTemplate) {
"Piwik" + "Piwik" +
sha384(config.t_url); sha384(config.t_url);
const stringed = toObject(atmos);
const search = what => atmos.find(element => element.id === what);
const mos = search(v)
if (mos) {
var url_e =
mos.url +
"?e=" +
sha384(k.Video.Channel.id) +
sha384(k.Video.Channel.id) +
"Piwik" +
sha384(config.t_url);
} else {
}
// channel info // channel info
const engagement = fetching.engagement; const engagement = fetching.engagement;
const channel = await modules.fetch( const channel = await modules.fetch(