add isoldwindows lol

This commit is contained in:
Ashley 2023-05-16 18:14:11 +00:00
parent baace88340
commit 731c7629d4

View file

@ -39,9 +39,7 @@ module.exports = function (app, config, renderTemplate) {
.getColors(`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`)
.then((colors) => colors[0].hex()),
});
} catch {
} catch {
res.redirect("/");
}
});
@ -57,17 +55,27 @@ module.exports = function (app, config, renderTemplate) {
app.get("/search", async (req, res) => {
const query = req.query.query;
const poketube_universe_value = "poketube_smart_search"
var uaos = req.useragent.os;
var IsOldWindows;
if(query.includes("youtube.com")){
if (uaos == "Windows 7" && req.useragent.browser == "Firefox") {
IsOldWindows = true;
} else if (uaos == "Windows 8" && req.useragent.browser == "Firefox") {
IsOldWindows = true;
} else {
IsOldWindows = false;
}
const poketube_universe_value = "poketube_smart_search";
if (query.includes("youtube.com")) {
try {
var videoid = query.split("v=")
var videoid = query.split("v=");
res.redirect("/watch?v=" + videoid[1])
res.redirect("/watch?v=" + videoid[1]);
} catch {
return;
}
}
if (!query) {
@ -99,6 +107,7 @@ module.exports = function (app, config, renderTemplate) {
renderTemplate(res, req, "search.ejs", {
j: searchJson,
IsOldWindows,
h: didYouMean,
continuation,
q: query,