From 0c2c26420412023aa0ea57e8c239585d2a959a14 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 11 Nov 2023 13:08:10 +0000 Subject: [PATCH 01/63] remove useless code --- html/channel.ejs | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/html/channel.ejs b/html/channel.ejs index 6572debd..9e32566d 100644 --- a/html/channel.ejs +++ b/html/channel.ejs @@ -1312,52 +1312,7 @@ width: fit-content; From 99c92c4d478f6843f1403a0d385c2f43099ed749 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 11 Nov 2023 14:28:41 +0000 Subject: [PATCH 02/63] lemme see if this speeds it up or nah --- 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 8d6b08ad..8016bb3b 100644 --- a/src/libpoketube/libpoketube-dislikes.js +++ b/src/libpoketube/libpoketube-dislikes.js @@ -41,7 +41,7 @@ class PokeTubeDislikesAPIManager { * @private */ async _getEngagementData() { - const fallbackUrl = `https://p.poketube.fun/api?v=${this.videoId}`; + const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`; const { fetch } = await import("undici"); From e15597573f932af94e73db0bcec295e6107b0a85 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 11 Nov 2023 18:38:29 +0000 Subject: [PATCH 03/63] add filters!! --- html/search.ejs | 178 ++++++++++++++++++++---------------------------- 1 file changed, 72 insertions(+), 106 deletions(-) diff --git a/html/search.ejs b/html/search.ejs index 32ee96fc..2038fa1f 100644 --- a/html/search.ejs +++ b/html/search.ejs @@ -33,7 +33,7 @@ <% } %> <% if (q != "do the harlem shake") { %> - + <% } %> @@ -403,7 +403,58 @@ video[counter].classList.add("shake");
-
+
+
Filters +
+ + +
+
Upload date
+
+<% const selectedDate = date || "none"; %> + +<% ['none', 'hour', 'today', 'week', 'month', 'year'].forEach(option => { %> +
+ > + +
+<% }) %>
+
+
Duration
+
+ <% const selectedDuration = duration || "none"; %> + +<% ['none', 'short', 'long', 'medium'].forEach(option => { %> +
+ > + +
+<% }) %> + +
+ +
+
Sort By
+
+ <% const selectedSort = sort || "relevance"; %> + +<% ['relevance', 'rating', 'date', 'views'].forEach(option => { %> +
+ > + +
+<% }) %> + +
+
+ +
+
+ <% if (!tab) { %> - - <% if (Array.isArray( j.Search.Results.Video)) { %> -
- <% if (j.Search.Results.DynamicItem) { %> - - <% if (j.Search.Results.DynamicItem.id == "didYouMeanRenderer") { %> - <% if (h) { %> - - <% if (h.correctedQueryEndpoint) { %> - - <% if (h.correctedQueryEndpoint.searchEndpoint) { %> - - - <% } %> <% } %> - <% } %> <% } %> - <% } %> - -
- <% if (!j.Search.Results.DynamicItem) { %> - - <% if (!continuation) { %> - - <% if (summary.extract_html) { %> -
- -
From da web From wikipedia under CC-BY-SA 3.0 -
- -
- - <%-summary.extract_html%> - - - - - - -

-
- - <% } %> <% } %> - <% } %> - - <% if (j.Search.Results.CardList) { %> - - <% if (j.Search.Results.CardList.title == "People also search for") { %> - - - -
- - <% } %> <% } %> - - - <% j.Search.Results.Video.forEach(x => { %> + <% invresults.forEach (x => { %>
<%=x.duration %> + style="background-image: url('/vi/<%= x.videoId %>/hqdefault.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLBmAOZV7CM3NdDKlEFxGX7PpI5UWQ');border-radius: 10px;" + ><%=turntomins(x.lengthSeconds) %>
@@ -527,32 +495,31 @@ font-weight: 1000; <% }) %> - -

- <%=j.Search.estimatedResults.toLocaleString()%> Results (estimated) -

+ - +

- <% if (continuation) { %> + <% if (continuation !== "1") { %>

First Page

-

- Next Page -

+

+ Next Page +

+ <% } %> - <% if (!continuation) { %> + <% if (continuation == "1" || !continuation) { %>

- Next Page + Next Page

<% } %> @@ -561,8 +528,7 @@ font-weight: 1000;
- <% } %> - <% if (!Array.isArray( j.Search.Results.Video)) { %> + <% if (!Array.isArray(invresults)) { %>

From 2509fde9d32f317d60c4a1a6db3acc0cf02b07d0 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 11 Nov 2023 18:39:45 +0000 Subject: [PATCH 04/63] add filters!! --- .../init/pages-channel-and-download.js | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/libpoketube/init/pages-channel-and-download.js b/src/libpoketube/init/pages-channel-and-download.js index 83abfb75..c8a75bb0 100644 --- a/src/libpoketube/init/pages-channel-and-download.js +++ b/src/libpoketube/init/pages-channel-and-download.js @@ -62,6 +62,7 @@ module.exports = function (app, config, renderTemplate) { res.redirect(`/watch?v=${v}`); }); + app.get("/search", async (req, res) => { const query = req.query.query; const tab = req.query.tab; @@ -101,28 +102,28 @@ module.exports = function (app, config, renderTemplate) { } let continuation = req.query.continuation || ""; - + let date = req.query.date || ""; + let type = req.query.type || ""; + let duration = req.query.duration || ""; + let sort = req.query.sort || ""; + try { const headers = {}; - const searchUrl = `https://inner-api.poketube.fun/api/search?query=${encodeURIComponent( + const xmlData = await fetch(`https://invid-api.poketube.fun/api/v1/search?q=${encodeURIComponent( query - )}&continuation=${encodeURIComponent(continuation)}`; - const player = await fetch(searchUrl); - const xmlData = await player.text(); - const searchJson = JSON.parse(modules.toJson(xmlData)); - - let didYouMean; - if ( - searchJson.Search?.Results?.DynamicItem?.id === "didYouMeanRenderer" - ) { - didYouMean = JSON.parse(searchJson.Search.Results.DynamicItem.Title); - } - + )}&page=${encodeURIComponent(continuation)}&date=${date}&type=${type}&duration=${duration}&sort=${sort}&hl=en+gb`) + .then((res) => res.text()) + .then((txt) => getJson(txt)); + renderTemplate(res, req, "search.ejs", { - j: searchJson, + invresults: xmlData, + turntomins, + date, + type, + duration, + sort, IsOldWindows, - h: didYouMean, tab, continuation, results: "", From 45c5ba9201ee29d46c6e0bc66c65189118e48aec Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 11 Nov 2023 18:45:19 +0000 Subject: [PATCH 05/63] make it close by def --- html/search.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/search.ejs b/html/search.ejs index 2038fa1f..f632ca2b 100644 --- a/html/search.ejs +++ b/html/search.ejs @@ -404,7 +404,7 @@ video[counter].classList.add("shake");

-
Filters +
Filters
From 5f383b53d15c532aff1973c5795cddce79867708 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 11 Nov 2023 19:07:21 +0000 Subject: [PATCH 06/63] test this --- src/libpoketube/libpoketube-dislikes.js | 35 +++++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/libpoketube/libpoketube-dislikes.js b/src/libpoketube/libpoketube-dislikes.js index 8016bb3b..7af72c0e 100644 --- a/src/libpoketube/libpoketube-dislikes.js +++ b/src/libpoketube/libpoketube-dislikes.js @@ -9,7 +9,7 @@ /** * A class representing a PokeTube API instance for a specific video. */ -class PokeTubeDislikesAPIManager { +class PokeTubeDislikesAPIManager { /** * Creates a new PokeTube API instance for the given video ID. * @param {string} videoId - The ID of the YouTube video. @@ -41,12 +41,31 @@ class PokeTubeDislikesAPIManager { * @private */ async _getEngagementData() { - const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`; - - const { fetch } = await import("undici"); - - const engagement = await fetch(fallbackUrl).then((res) => res.json()); - return engagement; + const apiUrls = [ + "https://returnyoutubedislikeapi.com/votes?videoId=", + "https://prod-poketube.testing.poketube.fun/api?v=", + ]; + + const { fetch } = await import("undici"); + + // Initialize an array to store errors when trying different URLs + const errors = []; + + for (const apiUrl of apiUrls) { + try { + // Fetch data from the current URL + const engagement = await fetch(apiUrl + this.videoId).then((res) => + res.json() + ); + + return engagement; // Exit the loop if successful + } catch (err) { + // Log the error for this URL and continue to the next URL + console.log(`Error fetching data from ${apiUrl}: ${err.message}`); + errors.push(err.message); + return ""; + } + } } /** @@ -58,7 +77,7 @@ class PokeTubeDislikesAPIManager { return { engagement: this.engagement, - }; + }; } /** From 462ffada2914f89b05a7e5d70098de28ae7617ef Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 08:20:29 +0000 Subject: [PATCH 07/63] add new channel border lel --- html/channel.ejs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/channel.ejs b/html/channel.ejs index 9e32566d..06d98e34 100644 --- a/html/channel.ejs +++ b/html/channel.ejs @@ -49,9 +49,12 @@ src:url('https://p.poketube.fun/https://cdn.statically.io/gh/brecert/discord-quote-generator/main/Ginto-Nord-800.woff') format("woff"); } + .channel-info-container > img { - width: 100%; + width: 98%; border-radius: 1em; + margin-top: 6px; + margin-bottom: -9px; } :root { --text-primary: #fff; From b172ff12f97efbbca2f795dd3478fa246a011544 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 08:38:40 +0000 Subject: [PATCH 08/63] add subscribe button!! --- html/channel.ejs | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/html/channel.ejs b/html/channel.ejs index 06d98e34..7a58be29 100644 --- a/html/channel.ejs +++ b/html/channel.ejs @@ -561,7 +561,7 @@ color:#ea9999 !important; <% } %> -
+

<%=j.Channel?.Metadata.Name%> @@ -593,18 +593,20 @@ color:#ea9999 !important;

Error: <%= error.message %>

<% } %> - -

-
- - +

+ +
+ +
<% if (!isMobile) { %> -
- <% if (!tab) { %> +
+ <% if (!tab) { %> Videos @@ -1316,7 +1318,20 @@ width: fit-content; From f573d0ddeb99b95215973bb63d337687a52d3a2b Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 08:39:46 +0000 Subject: [PATCH 09/63] add ryd api url back --- src/libpoketube/libpoketube-dislikes.js | 35 ++++++------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/src/libpoketube/libpoketube-dislikes.js b/src/libpoketube/libpoketube-dislikes.js index 7af72c0e..8016bb3b 100644 --- a/src/libpoketube/libpoketube-dislikes.js +++ b/src/libpoketube/libpoketube-dislikes.js @@ -9,7 +9,7 @@ /** * A class representing a PokeTube API instance for a specific video. */ -class PokeTubeDislikesAPIManager { +class PokeTubeDislikesAPIManager { /** * Creates a new PokeTube API instance for the given video ID. * @param {string} videoId - The ID of the YouTube video. @@ -41,31 +41,12 @@ class PokeTubeDislikesAPIManager { * @private */ async _getEngagementData() { - const apiUrls = [ - "https://returnyoutubedislikeapi.com/votes?videoId=", - "https://prod-poketube.testing.poketube.fun/api?v=", - ]; - - const { fetch } = await import("undici"); - - // Initialize an array to store errors when trying different URLs - const errors = []; - - for (const apiUrl of apiUrls) { - try { - // Fetch data from the current URL - const engagement = await fetch(apiUrl + this.videoId).then((res) => - res.json() - ); - - return engagement; // Exit the loop if successful - } catch (err) { - // Log the error for this URL and continue to the next URL - console.log(`Error fetching data from ${apiUrl}: ${err.message}`); - errors.push(err.message); - return ""; - } - } + const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`; + + const { fetch } = await import("undici"); + + const engagement = await fetch(fallbackUrl).then((res) => res.json()); + return engagement; } /** @@ -77,7 +58,7 @@ class PokeTubeDislikesAPIManager { return { engagement: this.engagement, - }; + }; } /** From f435cfe7fed48f4867dc9a843e8cac46b47172d7 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 11:35:00 +0000 Subject: [PATCH 10/63] test this --- src/libpoketube/libpoketube-dislikes.js | 28 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/libpoketube/libpoketube-dislikes.js b/src/libpoketube/libpoketube-dislikes.js index 8016bb3b..a2b8e41f 100644 --- a/src/libpoketube/libpoketube-dislikes.js +++ b/src/libpoketube/libpoketube-dislikes.js @@ -9,7 +9,7 @@ /** * A class representing a PokeTube API instance for a specific video. */ -class PokeTubeDislikesAPIManager { +class PokeTubeDislikesAPIManager { /** * Creates a new PokeTube API instance for the given video ID. * @param {string} videoId - The ID of the YouTube video. @@ -41,12 +41,24 @@ class PokeTubeDislikesAPIManager { * @private */ async _getEngagementData() { - const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`; - - const { fetch } = await import("undici"); - - const engagement = await fetch(fallbackUrl).then((res) => res.json()); - return engagement; + const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`; + + const { fetch } = await import("undici"); + + // why RYD? why... do i have to this lol? + for (let i = 0; i < 2; i++) { + try { + const engagement = await fetch(fallbackUrl).then((res) => res.json()); + return engagement; + } catch (err) { + if (err.status === 503) { + // retry after a bit + await new Promise((resolve) => setTimeout(resolve, 1000)); + } else { + throw err; + } + } + } } /** @@ -58,7 +70,7 @@ class PokeTubeDislikesAPIManager { return { engagement: this.engagement, - }; + }; } /** From 572cfcaf2b8d6d646112c49ca864dc5a199348bd Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 11:55:43 +0000 Subject: [PATCH 11/63] add cachefixer --- src/libpoketube/libpoketube-dislikes.js | 28 +++++++------------------ 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/libpoketube/libpoketube-dislikes.js b/src/libpoketube/libpoketube-dislikes.js index a2b8e41f..d9eab133 100644 --- a/src/libpoketube/libpoketube-dislikes.js +++ b/src/libpoketube/libpoketube-dislikes.js @@ -9,7 +9,7 @@ /** * A class representing a PokeTube API instance for a specific video. */ -class PokeTubeDislikesAPIManager { +class PokeTubeDislikesAPIManager { /** * Creates a new PokeTube API instance for the given video ID. * @param {string} videoId - The ID of the YouTube video. @@ -41,24 +41,12 @@ class PokeTubeDislikesAPIManager { * @private */ async _getEngagementData() { - const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`; - - const { fetch } = await import("undici"); - - // why RYD? why... do i have to this lol? - for (let i = 0; i < 2; i++) { - try { - const engagement = await fetch(fallbackUrl).then((res) => res.json()); - return engagement; - } catch (err) { - if (err.status === 503) { - // retry after a bit - await new Promise((resolve) => setTimeout(resolve, 1000)); - } else { - throw err; - } - } - } + const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}&cachefixer=${btoa(Date.now())}`; + + const { fetch } = await import("undici"); + + const engagement = await fetch(fallbackUrl).then((res) => res.json()); + return engagement; } /** @@ -70,7 +58,7 @@ class PokeTubeDislikesAPIManager { return { engagement: this.engagement, - }; + }; } /** From 5a731b383e84172032dc9e0c32034ca593b03ee9 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 13:30:02 +0000 Subject: [PATCH 12/63] add fix for this --- src/libpoketube/init/pages-video.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index 5424f87f..140329b7 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -310,7 +310,7 @@ module.exports = function (app, config, renderTemplate) { } } catch (error) { console.error(error); - return res.redirect("/?fromerror=41_generic_error"); + return res.redirect(`/watch?v=${req.query.v}&f=1`); } }); }); From fd9c40362e86132f5a9ce98ee813c2d0d72825b9 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 14:34:48 +0000 Subject: [PATCH 13/63] add h --- src/libpoketube/libpoketube-core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 45f9df12..caa64dfb 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -79,10 +79,10 @@ class PokeTubeCore { try { const [invComments, videoInfo, videoData] = await Promise.all([ - fetch(`${this.config.invapi}/comments/${v}?hl=${contentlang}®ion=${contentregion}`).then((res) => res.text()), - fetch(`${this.config.invapi}/videos/${v}?hl=${contentlang}®ion=${contentregion}`).then((res) => res.text()), + fetch(`${this.config.invapi}/comments/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text()), + fetch(`${this.config.invapi}/videos/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text()), curly - .get(`${this.config.tubeApi}video?v=${v}`, { + .get(`${this.config.tubeApi}video?v=${v}&h=${btoa(Date.now())}`, { httpHeader: Object.entries(headers).map(([k, v]) => `${k}: ${v}`), }) .then((res) => { From 679e530a89549849f52696aab12c9919c457b5d3 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 14:40:06 +0000 Subject: [PATCH 14/63] hmmmmmmmmmmmmmmm --- src/libpoketube/libpoketube-core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index caa64dfb..826354bb 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -82,7 +82,7 @@ class PokeTubeCore { fetch(`${this.config.invapi}/comments/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text()), fetch(`${this.config.invapi}/videos/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text()), curly - .get(`${this.config.tubeApi}video?v=${v}&h=${btoa(Date.now())}`, { + .get(`${this.config.tubeApi}video?v=${v}`, { httpHeader: Object.entries(headers).map(([k, v]) => `${k}: ${v}`), }) .then((res) => { From c819f6cd4aaf77a92112c75b439137fad6baba50 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 14:51:08 +0000 Subject: [PATCH 15/63] add fx --- src/libpoketube/init/pages-video.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index 140329b7..fc9f6a77 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -310,7 +310,7 @@ module.exports = function (app, config, renderTemplate) { } } catch (error) { console.error(error); - return res.redirect(`/watch?v=${req.query.v}&f=1`); + return res.redirect(`/watch?v=${req.query.v}&fx=1`); } }); }); From 58c9bd4f10094f05c054dd2188e6f9e13b3b1d16 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 14:58:48 +0000 Subject: [PATCH 16/63] add remove fx --- css/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/css/app.js b/css/app.js index b8e79789..d810ed79 100644 --- a/css/app.js +++ b/css/app.js @@ -1,5 +1,15 @@ // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-3.0-or-later +// Get the current URL +const url = new URL(window.location.href); + +// Remove the 'fx' query parameter +url.searchParams.delete('fx'); + +// Replace the current URL without the 'fx' parameter +history.replaceState(null, '', url.toString()); + + // Retrieve volume from local storage or set to max if not available const initialVolume = localStorage.getItem('playerVolume') || 1; const video = document.getElementById('video'); From 5900bc5b11565c9db316fe8bda728b6d19d4876d Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 15:07:44 +0000 Subject: [PATCH 17/63] h --- src/libpoketube/init/pages-video.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index fc9f6a77..bfe53e2d 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -310,7 +310,7 @@ module.exports = function (app, config, renderTemplate) { } } catch (error) { console.error(error); - return res.redirect(`/watch?v=${req.query.v}&fx=1`); + return res.redirect(`/watch?v=${req.query.v}&fx=1&err=${btoa(error)}`); } }); }); From ed1b646a40f7b96e26446c7550111dd180bc3440 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 12 Nov 2023 15:10:18 +0000 Subject: [PATCH 18/63] yeah --- html/channel.ejs | 1 - 1 file changed, 1 deletion(-) diff --git a/html/channel.ejs b/html/channel.ejs index 7a58be29..647aed7b 100644 --- a/html/channel.ejs +++ b/html/channel.ejs @@ -1,5 +1,4 @@ <% try { %> - From 91a3e4f4e19b462a5277591bb267f68f8d2ce9dd Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 13 Nov 2023 17:05:08 +0000 Subject: [PATCH 22/63] bump version owo --- src/libpoketube/init/pages-api.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/libpoketube/init/pages-api.js b/src/libpoketube/init/pages-api.js index 1815785c..01fcb3a8 100644 --- a/src/libpoketube/init/pages-api.js +++ b/src/libpoketube/init/pages-api.js @@ -27,15 +27,23 @@ function getJson(str) { } const pkg = require("../../../package.json"); -const ver = "v23.2809-aRi-MAJOR-stable-nonLTS-git-MTY5NTkxODIyMg=="; -const branch = "master"; -const codename = "ari"; -const versionnumber = "269"; -const relaseunixdate = "MTY5NTkxODIyMg=="; +const cnf = require("../../../config.json"); + +const ver = "v23.1311-aMy-MAJOR-stable-nonLTS-git-MTY5OTg5NDg3Mw=="; +const branch = "dev"; +const codename = "amy"; +const versionnumber = "270"; +const relaseunixdate = "MTY5OTg5NDg3Mw=="; module.exports = function (app, config, renderTemplate) { app.get("/embed/:v", async function (req, res) { - res.send("Disabled until further notice"); + res.send("Disabled until Q1 2024"); + }); + + app.get("/admin", async function (req, res) { + if(req.hostname === "poketube.fun") { + res.redirect("https://console.sudovanilla.com/?from=pt_admin") + } }); app.get("/vi/:v/:t", async function (req, res) { @@ -153,6 +161,7 @@ app.get("/avatars/:v", async function (req, res) { relaseunixdate, vernum: versionnumber, codename, + config:cnf, packages: { libpt: version, node: process.version, From 5fd8b6712af9036b61889516d775ee794fcb6da1 Mon Sep 17 00:00:00 2001 From: Ashley Date: Tue, 14 Nov 2023 09:53:08 +0000 Subject: [PATCH 23/63] set the search type to video lol --- src/libpoketube/init/pages-channel-and-download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpoketube/init/pages-channel-and-download.js b/src/libpoketube/init/pages-channel-and-download.js index c8a75bb0..e402ebff 100644 --- a/src/libpoketube/init/pages-channel-and-download.js +++ b/src/libpoketube/init/pages-channel-and-download.js @@ -103,7 +103,7 @@ module.exports = function (app, config, renderTemplate) { let continuation = req.query.continuation || ""; let date = req.query.date || ""; - let type = req.query.type || ""; + let type = "video"; let duration = req.query.duration || ""; let sort = req.query.sort || ""; From f23f52d589a5908aa0f5f5018ab6cc5d824e600b Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 15 Nov 2023 13:11:02 +0000 Subject: [PATCH 24/63] add center lol --- html/poketube.ejs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 6863cd35..64b86041 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -2364,12 +2364,13 @@ font-size: 13px;margin:0;padding:0;white-space: nowrap;
-
+
+ -
<%=inv_vid.title%>
+
<%=inv_vid.title%>
<% if (inv_vid.genre === "Music") { %> -  Lossless Audio +  Lossless Audio <% } %>
-
+

@@ -2421,7 +2428,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") %>
From 716eb8a388b9f21cb6116863e0554144ad78d008 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 15 Nov 2023 13:46:27 +0000 Subject: [PATCH 26/63] add comments button lol --- html/poketube.ejs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 067430d1..18df8f9d 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -2235,6 +2235,15 @@ font-size: 13px;margin:0;padding:0;white-space: nowrap; Download
+ <% if (Array.isArray( inv.comments)) { %> + +
+ + + View Comments +
+
+ <% }%> <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> <% if (!inv_vid.title.endsWith('Audio)')) { %> @@ -2254,7 +2263,7 @@ font-size: 13px;margin:0;padding:0;white-space: nowrap; <% }%> <% }%> <% }%> - +
@@ -2729,7 +2738,7 @@ More Epic options owo~ + + + <% } %> From 1d702eb699f10a3d1f00ce1b79ffa745cb72b438 Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 16 Nov 2023 17:59:10 +0000 Subject: [PATCH 35/63] add ambient mode --- html/lite.ejs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/html/lite.ejs b/html/lite.ejs index 90a45436..04bed845 100644 --- a/html/lite.ejs +++ b/html/lite.ejs @@ -244,6 +244,27 @@ background: none !important; word-break: break-all; white-space: normal; } + + <% if (lightOrDark(color) == "light") { %> + .player.video-ambient-container { + box-shadow: 0 -8px 5.9em <%=color%>; + } + + <% } %> + + <% if (lightOrDark(color) == "dark") { %> + .player.video-ambient-container { + box-shadow: 0 -8px 5.9em <%=color2%>; + } + + <% } %> + <% if (a) { %> + + .player.video-ambient-container { + box-shadow: 0 0 0em <%=color%>; + } + + <% } %> @@ -301,7 +322,7 @@ background: none !important;
-
+