add school proxy stuff yeah 4r3wedtgerdf

This commit is contained in:
Ashley 2024-01-05 16:26:58 +00:00
parent 8c5ba7945f
commit 956465586f

View file

@ -90,7 +90,11 @@ module.exports = function (app, config, renderTemplate) {
const { fetch } = await import("undici"); const { fetch } = await import("undici");
const search = require("google-it"); const search = require("google-it");
var media_proxy = config.media_proxy;
if (req.useragent.source.includes("Pardus")) {
var media_proxy = "https://media-proxy.ashley0143.xyz";
}
var uaos = req.useragent.os; var uaos = req.useragent.os;
var IsOldWindows; var IsOldWindows;
@ -151,7 +155,7 @@ module.exports = function (app, config, renderTemplate) {
IsOldWindows, IsOldWindows,
tab, tab,
continuation, continuation,
media_proxy_url: config.media_proxy, media_proxy_url: media_proxy,
results: "", results: "",
q: query, q: query,
summary: "", summary: "",
@ -198,9 +202,9 @@ module.exports = function (app, config, renderTemplate) {
const search = require("google-it"); const search = require("google-it");
if (req.query.lucky === 'true') { if (req.query.lucky === "true") {
res.redirect('/im-feeling-lucky?query=' + query) res.redirect("/im-feeling-lucky?query=" + query);
} }
var uaos = req.useragent.os; var uaos = req.useragent.os;
var IsOldWindows; var IsOldWindows;
@ -257,13 +261,22 @@ module.exports = function (app, config, renderTemplate) {
app.get("/channel/", async (req, res) => { app.get("/channel/", async (req, res) => {
const { fetch } = await import("undici"); const { fetch } = await import("undici");
try { try {
var media_proxy = config.media_proxy;
if (req.useragent.source.includes("Pardus")) {
var media_proxy = "https://media-proxy.ashley0143.xyz";
}
var ID = req.query.id; var ID = req.query.id;
if (ID.endsWith('@youtube.com')) { if (ID.endsWith("@youtube.com")) {
ID = ID.slice(0, -'@youtube.com'.length); ID = ID.slice(0, -"@youtube.com".length);
} }
const tab = req.query.tab;
if (ID.endsWith("@poketube.fun")) {
ID = ID.slice(0, -"@poketube.fun".length);
}
const tab = req.query.tab;
const cache = {}; const cache = {};
try { try {
@ -368,7 +381,7 @@ module.exports = function (app, config, renderTemplate) {
cinv, cinv,
convert, convert,
turntomins, turntomins,
media_proxy_url: config.media_proxy, media_proxy_url: media_proxy,
dnoreplace, dnoreplace,
getThumbnailUrl, getThumbnailUrl,
continuation, continuation,