From 4ba022fba88187b48d49781e2c32bc4e17604d71 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 22 Nov 2023 04:54:25 +0000 Subject: [PATCH 1/5] fix ryd --- src/libpoketube/libpoketube-dislikes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libpoketube/libpoketube-dislikes.js b/src/libpoketube/libpoketube-dislikes.js index daa52590..f7bed745 100644 --- a/src/libpoketube/libpoketube-dislikes.js +++ b/src/libpoketube/libpoketube-dislikes.js @@ -48,11 +48,11 @@ class PokeTubeDislikesAPIManager { try { - const engagement = await fetch(fallbackUrl).then((res) => res.json()); + const engagement = await fetch(apiUrl).then((res) => res.json()); return engagement; } catch { - try { - const engagement = await fetch(apiUrl).then((res) => res.json()); + try + const engagement = await fetch(fallbackUrl).then((res) => res.json()); return engagement; } catch { return null; From 3fb860615677fae7ffec22314a62594584ee94b0 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 22 Nov 2023 04:58:00 +0000 Subject: [PATCH 2/5] lmao Signed-off-by: Ashley --- src/libpoketube/libpoketube-dislikes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpoketube/libpoketube-dislikes.js b/src/libpoketube/libpoketube-dislikes.js index f7bed745..160810c2 100644 --- a/src/libpoketube/libpoketube-dislikes.js +++ b/src/libpoketube/libpoketube-dislikes.js @@ -51,7 +51,7 @@ class PokeTubeDislikesAPIManager { const engagement = await fetch(apiUrl).then((res) => res.json()); return engagement; } catch { - try + try { const engagement = await fetch(fallbackUrl).then((res) => res.json()); return engagement; } catch { From 88c745e89228f50a4ae27f3107a4c66607d553ed Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 22 Nov 2023 08:56:35 +0000 Subject: [PATCH 3/5] fix issues Signed-off-by: Ashley --- html/poketube.ejs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 110b0baa..36bd39b1 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -941,7 +941,7 @@ display: block; !important;" autoplay controls <% } %> -
+
<% if (!qua) { %> @@ -1732,7 +1732,8 @@ if (userID) { -<% if(!IsOldWindows) { %> + +<% if(IsOldWindows) { %> From 9a66aa08a7f62529e814f1253d9e10a5a4a67094 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 22 Nov 2023 16:11:01 +0000 Subject: [PATCH 4/5] test ignore --- p/server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/p/server.js b/p/server.js index 1d82f190..4595afd3 100644 --- a/p/server.js +++ b/p/server.js @@ -1,6 +1,7 @@ const express = require("express"); const fetch = require("node-fetch"); const { URL } = require("url"); +const { Readable } = require("node:stream"); // Array of hostnames that will be proxied const URL_WHITELIST = [ @@ -58,6 +59,8 @@ app.use(function (req, res, next) { * @param {express.Response} res */ const proxy = async (req, res) => { + const { fetch } = await import("undici") + try { let url; @@ -80,7 +83,7 @@ const proxy = async (req, res) => { method: req.method, }); - f.body.pipe(res); +Readable.fromWeb(f.body).pipe(res); } catch (e) { console.log(`==> Error: ${e}`); res.status(500).send("Internal server error"); From 82fd1371528a7e0cdcc2d851fefa47c11573d60e Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 22 Nov 2023 18:59:27 +0000 Subject: [PATCH 5/5] add stats for nerds to mobile :3 --- html/poketube.ejs | 73 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 36bd39b1..e3e66523 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -2064,7 +2064,7 @@ a {
@@ -2320,7 +2320,7 @@ font-size: 13px;margin:0;padding:0;white-space: nowrap;
-
+
<%-String(channelurlfixer(inv_vid.descriptionHtml)).replace(/\n/g, "
").replace(/twitter\.com/g, "nitter.net").replace(/reddit\.com/g, "teddit.net") %>
<% } %> + + <% if (!twitter) { %> + <% if (!discord) { %> + <% if (!reddit) { %> + <% if (!twitch) { %> + + <% if (!instagram) { %> +
+ Nyo connections found ;_; +
+ <% } %> + <% } %> + <% } %> + + <% } %> <% } %>
@@ -2416,14 +2431,54 @@ the channels social media accounts!
- - + +
+
Stats for 🤓
+ + Video id : <%=inv_vid.videoId%>
+ ImmersiveAmbientModecolor: <% if (lightOrDark(color) == "light") { %><%=color%> (color 1)<% } %><% if (lightOrDark(color) == "dark") { %> <%=color2%> (color 2) <% } %>
+ Video Format :<% if (!qua) { %> 22 (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz <% } %> + <% if (qua === "medium") { %> 18 (320p) openh264 (https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz <% } %>
+ PokeTubeEncryptID: <%=sha384(inv_vid.videoId)%>
+ <% if (isvidious) { %> + + Proxy : <%= u.replace("https://","") %> - refresh the page to change the proxy location
+ <% } %> + <% if (!isvidious) { %> + + Proxy : tube.kuylar.dev - refresh the page to change the proxy location
+ <% } %> + Date : <%- Date.now() %> - <%- useragent.os.replace("Linux", "GNU/Linux") %> on <%- useragent.browser %>
+ <% if (isvidious) { %> + + Mystery text : <%=btoa(inv_vid.videoId + " i " + " lov " + " u " + "mobile "+ u.replace("https://","") ) %>
+ <% } %> + <% if (!isvidious) { %> + + Mystery text : <%=btoa(inv_vid.videoId + " i " + " lov " + " u " + "tube.kuylar.dev" ) %>
+ <% } %> + + 143 : true
+
+ @@ -2807,10 +2862,7 @@ timeLinks.forEach(link => { } } }); - -// Set up an interval to check every second -setInterval(checkAndToggleRecommended, 1000); - + function removeParam(paramName) { let searchParams = new URLSearchParams(window.location.search); @@ -2855,7 +2907,8 @@ if (/[?&]autoplay=/.test(location.search)) { function autoplaynextvideo(e) { location.href = "/watch?v=<%- k.Video.Recommendations.Video[0].id%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + k.Video.Recommendations.Video[0].id ) %>" } -}var anchor = document.getElementById("sub"); +} + var anchor = document.getElementById("sub"); // Check if there's a user ID in localStorage var userID = localStorage.getItem("UserID");