From 650c816888735cefe0a8b62b6b5176fcf57da070 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Wed, 14 Feb 2024 04:02:32 +0000 Subject: [PATCH 01/37] bumpy version --- html/landing.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/landing.ejs b/html/landing.ejs index 0dc2d361..a4b942b9 100644 --- a/html/landing.ejs +++ b/html/landing.ejs @@ -27,7 +27,7 @@ - + From 3f39db0f6e2e9573cdffa4d68315be7a1b19dd60 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Wed, 14 Feb 2024 07:59:06 +0000 Subject: [PATCH 02/37] make gradient way visable --- css/landing.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/landing.css b/css/landing.css index ce39f613..1a98f912 100644 --- a/css/landing.css +++ b/css/landing.css @@ -890,7 +890,7 @@ video { height: 100%; object-fit: cover; z-index: -1; - opacity: 0.2; + opacity: 0.27; pointer-events: none; } From 0669346e752dadbfdedf1641de84fd4342d08df1 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Wed, 14 Feb 2024 07:59:38 +0000 Subject: [PATCH 03/37] bump --- html/landing.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/landing.ejs b/html/landing.ejs index a4b942b9..ed0fa380 100644 --- a/html/landing.ejs +++ b/html/landing.ejs @@ -27,7 +27,7 @@ - + From 6f1821dfd182bf0a6e7c14ae902823196813549c Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Wed, 14 Feb 2024 14:02:14 +0000 Subject: [PATCH 04/37] fix a thingy again --- html/poketube.ejs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index edd06561..e681c7b2 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -1239,13 +1239,11 @@ display: block; !important;" autoplay controls> <% }%> <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> - +
- Open In Music Player -
-
+WIP! <% }%> <% }%> @@ -2009,7 +2007,10 @@ window.addEventListener("unload", cleanup) - + <% } %> From de82939788a07baf32da1ce9a38aa2bd5e158028 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Wed, 14 Feb 2024 14:02:58 +0000 Subject: [PATCH 05/37] fix again --- html/poketube.ejs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index e681c7b2..98db6545 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -1199,7 +1199,7 @@ display: block; !important;" autoplay controls> <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> - <% if (!inv_vid.title.endsWith('Audio)')) { %> + <% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %> <% if (support != undefined) { %>
@@ -1238,7 +1238,7 @@ display: block; !important;" autoplay controls> <% }%> <% }%> <% }%> <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> - <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> + <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %>
@@ -1251,7 +1251,7 @@ WIP! <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> - <% if (!inv_vid.title.endsWith('Audio)')) { %> + <% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %> <% if (inv.comments) { %>
From d9a6e64eb23edbe1f33821c381ac8169d9d1da0c Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Wed, 14 Feb 2024 14:29:20 +0000 Subject: [PATCH 06/37] OOOPS SORRY --- html/poketube.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 98db6545..29d33921 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -1221,7 +1221,7 @@ display: block; !important;" autoplay controls> <% if (support == undefined) { %> <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> - <% if (!inv_vid.title.endsWith('Audio)')) { %> + <% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %>
From 81accc78f64ed1a59dd6a83e8db0ccbff8a1b21b Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Thu, 15 Feb 2024 19:42:13 +0000 Subject: [PATCH 07/37] added innertube stuff --- .../libpoketube-youtubei-objects.json | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/libpoketube/libpoketube-youtubei-objects.json diff --git a/src/libpoketube/libpoketube-youtubei-objects.json b/src/libpoketube/libpoketube-youtubei-objects.json new file mode 100644 index 00000000..269cc20b --- /dev/null +++ b/src/libpoketube/libpoketube-youtubei-objects.json @@ -0,0 +1,49 @@ +{ + "innertube": { + "innertubeApiVersion":"v1", + "pokevidious":"20.24", + "innertubeContextClientVersion":"2.20240214.05.00", + "youtubei":"https://www.youtube.com/youtubei/v1/", + "PAGE_BUILD_LABEL": "youtube.desktop.web_20240214_05_RC00", + "CLIENT": { + "clientName": "WEB", + "projectClientName":"PokeVidious", + "clientVersion": "2.20240214.05.00" + }, + "CONTEXT_CLIENT": { + "INNERTUBE_CONTEXT_CLIENT_NAME": "1", + "INNERTUBE_CONTEXT_CLIENT_VERSION": "2.20240214.05.00", + "INNERTUBE_CONTEXT_GL": "US", + "INNERTUBE_CONTEXT_HL": "en-US" + }, + "LATEST_ECATCHER_SERVICE_PARAMS": { "client.name": "WEB" }, + "INNERTUBE_API_KEYS": { + "WEB_KIDS": "AIzaSyBbZV_fZ3an51sF-mvs5w37OqqbsTOzwtU", + "WEB_MUSIC": "AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30", + "WEB_CREATOR": "AIzaSyBUPetSUmoZL-OhlxA7wSac5XinrygCqMo", + "WEB_REMIX": "AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30", + "WEB": "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + "ANDROID_MUSIC": "AIzaSyAOghZGza2MQSZkY_zfZ370N-PUdXEo8AI", + "ANDROID_EMBEDDED": "AIzaSyCjc_pVEDi4qsv5MtC2dMXzpIaDoRFLsxw", + "ANDROID_CREATOR": "AIzaSyD_qjV8zaaUMehtLkrKFgVeSX_Iqbtyws8", + "ANDROID_KIDS": "AIzaSyAxxQKWYcEX8jHlflLt2Qcbb-rlolzBhhk", + "ANDROID": "AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w", + "IOS_MUSIC": "AIzaSyBAETezhkwP0ZWA02RsqT1zu78Fpt0bC_s", + "IOS_CREATOR": "AIzaSyAPyF5GfQI-kOa6nZwO8EsNrGdEx9bioNs", + "IOS_KIDS": "AIzaSyA6_JWXwHaVBQnoutCv1-GvV97-rJ949Bc", + "IOS": "AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc", + "TV": "AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8" + }, + "INNERTUBE_API_ENPOINTS": { + "UPLOAD_ENPOINT": "https://upload.youtube.com", + "LIVE_CHAT_BASE_TANGO_CONFIG": { + "apiKey": "AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8", + "channelUri": "https://client-channel.google.com/client-channel/client", + "clientName": "yt-live-comments", + "requiresAuthToken": false, + "senderUri": "https://clients4.google.com/invalidation/lcs/client", + "useNewTango": true + } + } + } +} From edba607a7626c71bb458c58ff20bdde9e058c273 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Thu, 15 Feb 2024 20:08:45 +0000 Subject: [PATCH 08/37] use innertube objects insted --- server.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 76a19d8a..caec3a64 100644 --- a/server.js +++ b/server.js @@ -31,6 +31,8 @@ } = require("./src/libpoketube/libpoketube-initsys.js"); const media_proxy = require("./src/libpoketube/libpoketube-video.js"); const { sinit } = require("./src/libpoketube/init/superinit.js"); + const innertube = require("./src/libpoketube/libpoketube-youtubei-objects.json"); + const config = require("./config.json"); const u = await media_proxy(); initlog("Loading..."); @@ -160,10 +162,12 @@ toobusy.maxLag(3500); }); app.use(function (req, res, next) { - res.header("X-PokeTube-Youtube-Client-Name", "1"); + res.header("X-PokeTube-Youtube-Client-Name", innertube.innertube.CONTEXT_CLIENT.INNERTUBE_CONTEXT_CLIENT_NAME); res.header("Hey-there", "Do u wanna help poke? contributons are welcome :3 https://codeberg.org/Ashley/poke") - res.header("X-PokeTube-Youtube-Client-Version", "2.20240111.00.00"); + res.header("X-PokeTube-Youtube-Client-Version", innertube.innertube.CLIENT.clientVersion); + res.header("X-PokeTube-Client-name", innertube.innertube.CLIENT.projectClientName); res.header("X-PokeTube-Speeder", "3 seconds no cache, 280ms w/cache"); + res.header("X-HOSTNAME", req.hostname); if (req.url.match(/^\/(css|js|img|font)\/.+/)) { res.setHeader( "Cache-Control", From c51819ed5356c43d14040b3d03c4b86fe8011aec Mon Sep 17 00:00:00 2001 From: Korbs Date: Thu, 15 Feb 2024 20:25:47 +0000 Subject: [PATCH 09/37] Try without `npm` installation --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 66f2062b..c934dca0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg - RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list RUN apt-get update -RUN apt-get -y install nodejs npm +RUN apt-get -y install nodejs # Install Packages RUN npm install From fd3a49d2c1d6d2ec8af4580833219ca8dbdd6bc4 Mon Sep 17 00:00:00 2001 From: Korbs Date: Thu, 15 Feb 2024 20:32:50 +0000 Subject: [PATCH 10/37] Downgrade NodeJS to v16 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c934dca0..605becdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,10 +22,10 @@ RUN apt-get update && apt-get -y install \ RUN mkdir -p /etc/apt/keyrings RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list RUN apt-get update -RUN apt-get -y install nodejs +RUN apt-get -y install nodejs npm # Install Packages RUN npm install From bfee31e39f2734bd26bb3e4c52ec6fdf924729e3 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 04:00:18 +0000 Subject: [PATCH 11/37] added innertube stuff --- server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server.js b/server.js index caec3a64..7b4f4b0f 100644 --- a/server.js +++ b/server.js @@ -177,6 +177,7 @@ toobusy.maxLag(3500); } const a = 890; + if (!req.url.match(/^\/(css|js|img|font)\/.+/)) { res.setHeader("Cache-Control", "public, max-age=" + a); // cache header res.setHeader("poketube-cacher", "PAGE"); From 1caf381588ec9038e6586e082f88729e1aa18ed3 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 04:03:48 +0000 Subject: [PATCH 12/37] use correct key --- src/libpoketube/libpoketube-youtubei-objects.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpoketube/libpoketube-youtubei-objects.json b/src/libpoketube/libpoketube-youtubei-objects.json index 269cc20b..6b09d629 100644 --- a/src/libpoketube/libpoketube-youtubei-objects.json +++ b/src/libpoketube/libpoketube-youtubei-objects.json @@ -37,7 +37,7 @@ "INNERTUBE_API_ENPOINTS": { "UPLOAD_ENPOINT": "https://upload.youtube.com", "LIVE_CHAT_BASE_TANGO_CONFIG": { - "apiKey": "AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8", + "apiKey": "AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc", "channelUri": "https://client-channel.google.com/client-channel/client", "clientName": "yt-live-comments", "requiresAuthToken": false, From 9963fd361c33020b2db59722f05f8ff7beafae57 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 04:23:07 +0000 Subject: [PATCH 13/37] added innertube stuff --- src/libpoketube/init/pages-api.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libpoketube/init/pages-api.js b/src/libpoketube/init/pages-api.js index e557e214..a7b605cf 100644 --- a/src/libpoketube/init/pages-api.js +++ b/src/libpoketube/init/pages-api.js @@ -28,6 +28,7 @@ function getJson(str) { const pkg = require("../../../package.json"); const cnf = require("../../../config.json"); +const innertube = require("../libpoketube-youtubei-objects.json"); const verfull = "v24.2801-JeSsIcA-MAJOR-stable-dev-nonLTS-git-MTcwNjQzMTc0OQ=="; const versmol = "v24.2801-JeSsIcA" @@ -188,6 +189,7 @@ app.get("/avatars/:v", async function (req, res) { v8: process.versions.v8, }, invidious, + innertube, flac: { poketube_flac: "1.2a", apple_musickit: "1.2.3", From 85dd3dcf457ec7f36bbaaff722c01916bd3ee887 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 14:47:10 +0000 Subject: [PATCH 14/37] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a32d4b31..8f7d59f9 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ git clone https://github.com/ashley0143/poke.git Or you can use our forgejo instance: ``` -git clone https://git.poketube.fun/ashley/poke.gitt +git clone https://git.poketube.fun/ashley/poke.git ``` Now, install the needed dependencies within the Poke folder: From 5dca0fa47fc32a1fcda3c346536fcd1700799f00 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 15:11:16 +0000 Subject: [PATCH 15/37] add poke.shiggy.cloud --- instances.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/instances.json b/instances.json index ac85f7f2..841de36a 100644 --- a/instances.json +++ b/instances.json @@ -57,6 +57,19 @@ "branch": "dev" } } + ], +[ + "poke.shiggy.cloud", + { + "uri": "https://poke.shiggy.cloud", + "CLOUDFLARE": false, + "piwik": false, + "region": "🇬🇧", + "software": { + "name": "poketube", + "version": "latest", + "branch": "dev" + } + } ] ] - From 41b38f61a8909ea599d391ecbf4a7dc39583d393 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 15:45:55 +0000 Subject: [PATCH 16/37] add innertube as a type --- src/libpoketube/libpoketube-initsys.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libpoketube/libpoketube-initsys.js b/src/libpoketube/libpoketube-initsys.js index 2bf2d3e4..bcb87213 100644 --- a/src/libpoketube/libpoketube-initsys.js +++ b/src/libpoketube/libpoketube-initsys.js @@ -2,7 +2,7 @@ PokeTube is a Free/Libre youtube front-end ! - Copyright (C) 2021-2023 POKETUBE + Copyright (C) 2021-2024 POKETUBE This file is Licensed under LGPL-3.0-or-later. Poketube itself is GPL, Only this file is LGPL. @@ -14,6 +14,7 @@ const fetcher = require("../libpoketube/libpoketube-dislikes.js"); const core = require("../libpoketube/libpoketube-core.js"); +const INNERTUBE = require("../libpoketube/libpoketube-core.js"); const musicInfo = require("music-info"); const wiki = require("wikipedia"); const config = require("../../config.json") @@ -68,6 +69,7 @@ module.exports = { * @type {object} */ core, + INNERTUBE, /** * The musicInfo module From d74397ebec41e749d8e7232f29bdaf97eac3d288 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 15:49:20 +0000 Subject: [PATCH 17/37] new class names! --- src/libpoketube/libpoketube-core.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index ff265d87..3f61187e 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -14,10 +14,10 @@ const getColors = require("get-image-colors"); /** * Class representing PokeTube's core functionality. */ -class PokeTubeCore { +class InnerTubePokeVidious { /** - * Create an instance of PokeTubeCore. - * @param {object} config - Configuration object for PokeTubeCore. + * Create an instance of InnerTubePokeVidious. + * @param {object} config - Configuration object for InnerTubePokeVidious. * @param {string} config.tubeApi - Tube API URL. * @param {string} config.invapi - Invid API URL. * @param {string} config.dislikes - Dislikes API URL. @@ -62,7 +62,7 @@ class PokeTubeCore { * @param {string} v - Video ID. * @returns {Promise} Promise resolving to the video information. */ - async video(v, contentlang, contentregion) { + async getYouTubeApiVideo(v, contentlang, contentregion) { const { fetch } = await import("undici"); @@ -167,8 +167,8 @@ class PokeTubeCore { } } -// Create an instance of PokeTubeCore with the provided config -const pokeTubeApiCore = new PokeTubeCore({ +// Create an instance of InnerTubePokeVidious with the provided config +const pokeTubeApiCore = new InnerTubePokeVidious({ tubeApi: "https://inner-api.poketube.fun/api/", invapi: "https://invid-api.poketube.fun/api/v1", invapi_alt: "https://iv.ggtyler.dev/api/v1", From 7d71b156ffb0000be2cfc3816847e6ffd031c731 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 15:52:22 +0000 Subject: [PATCH 18/37] use innertube objects instead --- src/libpoketube/init/pages-video.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index 0405b431..19f671bd 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -1,6 +1,6 @@ const { fetcher, - core, + INNERTUBE, wiki, musicInfo, modules, @@ -192,7 +192,7 @@ module.exports = function (app, config, renderTemplate) { var contentlang = hl || "en-US"; var contentregion = region || "US"; - const isVideoValid = await core.isvalidvideo(v); + const isVideoValid = await INNERTUBE.isvalidvideo(v); if (!isVideoValid) { return res.redirect("/?fromerror=21_video_not_valid"); } @@ -202,7 +202,7 @@ module.exports = function (app, config, renderTemplate) { const secure = ["poketube.fun"].includes(req.hostname); const verify = req.hostname === "poketube.sudovanilla.com"; - core.video(v, contentlang, contentregion).then((data) => { + INNERTUBE.getYouTubeApiVideo(v, contentlang, contentregion).then((data) => { try { const k = data?.video; const channel_uploads = data?.channel_uploads @@ -357,9 +357,9 @@ module.exports = function (app, config, renderTemplate) { engagement, comments: inv_comments, vid: inv_vid, - } = await core.video(v); + } = await INNERTUBE.getYouTubeApiVideo(v); - const data = await core.video(v); + const data = await INNERTUBE.getYouTubeApiVideo(v); const color = data.color; const color2 = data.color2; const desc = data?.desc; From 0c69ad0818fd9f29bfc9667834a8a814054dfd27 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 16:15:25 +0000 Subject: [PATCH 19/37] use invapi instead --- 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 3f61187e..bb913fd7 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -78,8 +78,8 @@ class InnerTubePokeVidious { try { const [invComments, videoInfo, videoData] = await Promise.all([ - fetch(`${this.config.invapi_alt}/comments/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text()), - fetch(`${this.config.invapi_alt}/videos/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).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}`, { httpHeader: Object.entries(headers).map(([k, v]) => `${k}: ${v}`), @@ -96,7 +96,7 @@ class InnerTubePokeVidious { const { json, video } = videoData; const channel_uploads = await fetch( - `${this.config.invapi_alt}/channels/${vid.authorId}?hl=${contentlang}®ion=${contentregion}` + `${this.config.invapi}/channels/${vid.authorId}?hl=${contentlang}®ion=${contentregion}` ); const p = this.getJson(await channel_uploads.text()); From 3995e387952ac806f84dc9ceee66e63ae0228522 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 16:30:24 +0000 Subject: [PATCH 20/37] use alt lol --- 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 bb913fd7..249cb1b9 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -96,7 +96,7 @@ class InnerTubePokeVidious { const { json, video } = videoData; const channel_uploads = await fetch( - `${this.config.invapi}/channels/${vid.authorId}?hl=${contentlang}®ion=${contentregion}` + `${this.config.invapi_alt}/channels/${vid.authorId}?hl=${contentlang}®ion=${contentregion}` ); const p = this.getJson(await channel_uploads.text()); From 1104b1579575fd748bc76aa94181d4c6c0a69b5a Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 16:41:01 +0000 Subject: [PATCH 21/37] add stuff --- src/libpoketube/libpoketube-core.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 249cb1b9..647dfe72 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -20,6 +20,7 @@ class InnerTubePokeVidious { * @param {object} config - Configuration object for InnerTubePokeVidious. * @param {string} config.tubeApi - Tube API URL. * @param {string} config.invapi - Invid API URL. + * @param {string} config.invapi_alt - Invid API URL - ALT . * @param {string} config.dislikes - Dislikes API URL. * @param {string} config.t_url - Matomo URL. */ @@ -27,6 +28,8 @@ class InnerTubePokeVidious { this.config = config; this.cache = {}; this.language = "hl=en-US"; + this.apikey = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8" + this.INNERTUBE_CONTEXT_CLIENT_VERSION = "1" this.region = "region=US"; this.sqp = "-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw"; } @@ -78,8 +81,8 @@ class InnerTubePokeVidious { try { const [invComments, videoInfo, videoData] = await Promise.all([ - 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()), + fetch(`${this.config.invapi_alt}/comments/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text()), + fetch(`${this.config.invapi_alt}/videos/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text()), curly .get(`${this.config.tubeApi}video?v=${v}`, { httpHeader: Object.entries(headers).map(([k, v]) => `${k}: ${v}`), From 410b39badfa9c5cc613606e4bbd21b698ddcd1ff Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 16:51:47 +0000 Subject: [PATCH 22/37] add the thingy --- src/libpoketube/libpoketube-core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 647dfe72..20b70a90 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -10,6 +10,7 @@ const { toJson } = require("xml2json"); const { curly } = require("node-libcurl"); const getdislikes = require("../libpoketube/libpoketube-dislikes.js"); const getColors = require("get-image-colors"); +const config = require("../../config.json") /** * Class representing PokeTube's core functionality. @@ -174,7 +175,7 @@ class InnerTubePokeVidious { const pokeTubeApiCore = new InnerTubePokeVidious({ tubeApi: "https://inner-api.poketube.fun/api/", invapi: "https://invid-api.poketube.fun/api/v1", - invapi_alt: "https://iv.ggtyler.dev/api/v1", + invapi_alt: config.proxylocation === "EU" ? "https://invid-api.poketube.fun/api/v1" : "https://iv.ggtyler.dev/api/v1", dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=", t_url: "https://t.poketube.fun/", }); From e3dfc49d407d12f5129fb5e327d60b8bca17afba Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 16:52:16 +0000 Subject: [PATCH 23/37] ad proxylocation --- config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config.json b/config.json index 987b259e..28704f70 100644 --- a/config.json +++ b/config.json @@ -7,6 +7,7 @@ "media_proxy": "https://image-proxy.poketube.fun", "cacher_max_age": "864000", "enablealwayshttps": false, + "proxylocation":"USA", "t_url": "https://t.poketube.fun/", "server_port": "6003" } \ No newline at end of file From ea5fa183b7b10b1a207ccc9bd07b3ee902013b24 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 17:00:55 +0000 Subject: [PATCH 24/37] Add proxylocation warning --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8f7d59f9..abaa6988 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,11 @@ you can view the source code of the openh264 codec in this repo :3 --> https://g PLEASE NOTE THAT THIS SOFTWARE MAY INCULUDE CODECS THAT IN CERTAIN COUNTRIES MAY BE COVERED BY PATENTS OR HAVE LEGAL ISSUES. PATENT AND COPYRIGHT LAWS OPERATE DIFFERENTLY DEPENDING ON WHICH COUNTRY YOU ARE IN. PLEASE OBTAIN LEGAL ADVICE IF YOU ARE UNSURE WHETHER A PARTICULAR PATENT OR RESTRICTION APPLIES TO A CODEC YOU WISH TO USE IN YOUR COUNTRY. ## Hosting Poke~ -### With NodeJS + +### IMPORTANT +Before you host, if ur server is in usa, set the proxylocation to `USA` (which is the default) - if you use any eu server set it to `EU` instead to make videos load faster + + ### With NodeJS - To self host your own Poke instance, you'll need the following: - [Node.js](https://nodejs.org/en/download/) @@ -107,7 +111,7 @@ git clone https://git.poketube.fun/ashley/poke.git ``` Now, install the needed dependencies within the Poke folder: -( go to the folder by running cd pokee) +( go to the folder by running cd poke) ``` npm install ``` From ab0a739808f0521d8461cbd03acd0b75555a3b30 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Fri, 16 Feb 2024 17:22:07 +0000 Subject: [PATCH 25/37] use min version --- html/poketube.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 29d33921..79e2823d 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -395,7 +395,7 @@ a[data-onclick="jump_to_time"] { <% } %> - +