From 9bbaecd268a6bddcf02b93076ff6f32177829535 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 25 Dec 2022 16:12:56 +0000 Subject: [PATCH] add secure instance icon !! --- src/libpoketube/init/pages-video.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index 978d5a9..3f936c5 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -101,6 +101,14 @@ function lightOrDark(color) { } } +function IsInArray(array, id) { + for (var i = 0; i < array.length; i++) { + if (array[i].id === id) return true; + } + return false; +} + + module.exports = function (app, config, renderTemplate) { app.get("/encryption", async function (req, res) { var v = req.query.v; @@ -167,6 +175,14 @@ module.exports = function (app, config, renderTemplate) { const isvld = await core.isvalidvideo(v); + var secure; + + if(req.hostname == "poketube.fun" || req.hostname == "poketube.site" || req.hostname == "poketube.online" || req.hostname == "poketube.xyz" || req.hostname == "watch.poketalebot.com") { + secure = true + } else { + secure = false + } + if (isvld) { core.video(v).then((data) => { if (data) { @@ -212,10 +228,11 @@ module.exports = function (app, config, renderTemplate) { engagement: engagement, video: json, date: k.Video.uploadDate, - e: e, - k: k, - process: process, - sha384: sha384, + e, + k, + secure, + process, + sha384, lightOrDark, isMobile: req.useragent.isMobile, tj: data.channel,