From 4ca76879c17ce1b02739af23857cbd0289d42093 Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sat, 14 Dec 2024 18:10:55 +0100 Subject: [PATCH 1/3] fixing invalid InvalidCharacterError web safe base64 encoding --- src/lib/helpers/verifyRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/helpers/verifyRequest.ts b/src/lib/helpers/verifyRequest.ts index 2a0ae08..3f60e4f 100644 --- a/src/lib/helpers/verifyRequest.ts +++ b/src/lib/helpers/verifyRequest.ts @@ -22,7 +22,7 @@ export const verifyRequest = ( ); const encryptedData = new TextDecoder().decode( - decipher.decrypt(decodeBase64(stringToCheck)), + decipher.decrypt(decodeBase64(stringToCheck.replace(/-/g, "+").replace(/_/g, "/"))), ); const [parsedTimestamp, parsedVideoId] = encryptedData.split("|"); const parsedTimestampInt = parseInt(parsedTimestamp); From b6c6c0f5455c87d6c00725ad07e1cfbbc8be6190 Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sat, 14 Dec 2024 22:57:19 +0100 Subject: [PATCH 2/3] bgutils generate use proxy --- src/lib/jobs/potoken.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/jobs/potoken.ts b/src/lib/jobs/potoken.ts index 0703f5a..0b1873b 100644 --- a/src/lib/jobs/potoken.ts +++ b/src/lib/jobs/potoken.ts @@ -42,8 +42,7 @@ export const poTokenGenerate = async ( }); const bgConfig: BgConfig = { - fetch: (input: string | URL | globalThis.Request, init?: RequestInit) => - fetch(input, init), + fetch: getFetchClient(konfigStore), globalObj: globalThis, identifier: visitorData, requestKey, From a8c029a271679055b22c97407a49223b0c03038d Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Mon, 16 Dec 2024 00:04:37 +0100 Subject: [PATCH 3/3] fixing wrong variable usage for urlToRedirect fixes #17 --- src/routes/invidious_routes/latestVersion.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/invidious_routes/latestVersion.ts b/src/routes/invidious_routes/latestVersion.ts index 2562534..4545801 100644 --- a/src/routes/invidious_routes/latestVersion.ts +++ b/src/routes/invidious_routes/latestVersion.ts @@ -71,7 +71,7 @@ latestVersion.get("/", async (c) => { const itagUrlParsed = new URL(itagUrl); let urlToRedirect = itagUrlParsed.toString(); if (local) { - urlToRedirect = itagUrlParsed.pathname + urlToRedirect.search + + urlToRedirect = itagUrlParsed.pathname + itagUrlParsed.search + "&host=" + itagUrlParsed.host; } return c.redirect(urlToRedirect);