mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-13 02:58:12 +01:00
add isoldwindows lol
This commit is contained in:
parent
baace88340
commit
731c7629d4
1 changed files with 21 additions and 12 deletions
|
@ -34,14 +34,12 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
var v = req.query.v;
|
var v = req.query.v;
|
||||||
|
|
||||||
renderTemplate(res, req, "download.ejs", {
|
renderTemplate(res, req, "download.ejs", {
|
||||||
v,
|
v,
|
||||||
color: await modules
|
color: await modules
|
||||||
.getColors(`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`)
|
.getColors(`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`)
|
||||||
.then((colors) => colors[0].hex()),
|
.then((colors) => colors[0].hex()),
|
||||||
});
|
});
|
||||||
|
} catch {
|
||||||
|
|
||||||
} catch {
|
|
||||||
res.redirect("/");
|
res.redirect("/");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -57,19 +55,29 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
app.get("/search", async (req, res) => {
|
app.get("/search", async (req, res) => {
|
||||||
const query = req.query.query;
|
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 {
|
try {
|
||||||
var videoid = query.split("v=")
|
var videoid = query.split("v=");
|
||||||
|
|
||||||
res.redirect("/watch?v=" + videoid[1])
|
res.redirect("/watch?v=" + videoid[1]);
|
||||||
} catch {
|
} catch {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!query) {
|
if (!query) {
|
||||||
return res.redirect("/");
|
return res.redirect("/");
|
||||||
}
|
}
|
||||||
|
@ -99,6 +107,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
|
|
||||||
renderTemplate(res, req, "search.ejs", {
|
renderTemplate(res, req, "search.ejs", {
|
||||||
j: searchJson,
|
j: searchJson,
|
||||||
|
IsOldWindows,
|
||||||
h: didYouMean,
|
h: didYouMean,
|
||||||
continuation,
|
continuation,
|
||||||
q: query,
|
q: query,
|
||||||
|
|
Loading…
Reference in a new issue