From 725161f01ed5101d1aa63366342be39697c5ce39 Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 20 Feb 2023 15:31:11 +0000 Subject: [PATCH] support button yaaay :3 --- src/libpoketube/init/pages-video.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index 50601703..efbf0090 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -124,6 +124,8 @@ function getJson(str) { } } +const PATREON_REGEX = /https:\/\/www.patreon.com\/(?[\w\d_-]+)/ + module.exports = function (app, config, renderTemplate) { app.get("/encryption", async function (req, res) { var v = req.query.v; @@ -258,11 +260,16 @@ module.exports = function (app, config, renderTemplate) { if (d === "[object Object]") { var d = false; } + + if (String(json.Description) != "[object Object]"){ + var support = (PATREON_REGEX.exec(json.Description) ?? {}).groups + } renderTemplate(res, req, "poketube.ejs", { color: data.color, color2: data.color2, engagement: engagement, + support, u, video: json, date: k.Video.uploadDate,