From 87bdb45f0edee56f4abd4724526f495de5938cd9 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 23 Sep 2023 15:32:51 +0000 Subject: [PATCH] add Region settings :3 --- src/libpoketube/init/pages-video.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index 60f513c1..8a2a8398 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -177,11 +177,14 @@ module.exports = function (app, config, renderTemplate) { }); app.get("/watch", async (req, res) => { - const { dm, v, e, r, f, m, quality: q, a, universe } = req.query; + const { dm, region, hl, v, e, r, f, m, quality: q, a, universe } = req.query; if (!v) { return res.redirect("/"); } + + var contentlang = hl || "en-US"; + var contentregion = region || "US"; const isVideoValid = await core.isvalidvideo(v); if (!isVideoValid) { @@ -193,7 +196,7 @@ module.exports = function (app, config, renderTemplate) { const secure = ["poketube.fun"].includes(req.hostname); const verify = req.hostname === "pt.zzls.xyz"; - core.video(v).then((data) => { + core.video(v, contentlang, contentregion).then((data) => { try { const k = data?.video; const json = data?.json;