diff --git a/package.json b/package.json index 791580bfdecc4..a1ebcd86398ad 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "freetube", "productName": "FreeTube", "description": "A private YouTube client", - "version": "0.23.11", + "version": "0.23.12", "license": "AGPL-3.0-or-later", "main": "./dist/main.js", "private": true, diff --git a/src/botGuardScript.js b/src/botGuardScript.js index aac39ec88749d..c648703ac87c6 100644 --- a/src/botGuardScript.js +++ b/src/botGuardScript.js @@ -6,10 +6,9 @@ import { BG, buildURL, GOOG_API_KEY } from 'bgutils-js' /** * Based on: https://github.com/LuanRT/BgUtils/blob/main/examples/node/innertube-challenge-fetcher-example.ts * @param {string} videoId - * @param {string} visitorData * @param {import('youtubei.js').Session['context']} context */ -export default async function (videoId, visitorData, context) { +export default async function (videoId, context) { const requestKey = 'O43z0dpjhgX20SCx4KAo' const challengeResponse = await fetch( @@ -19,7 +18,7 @@ export default async function (videoId, visitorData, context) { headers: { Accept: '*/*', 'Content-Type': 'application/json', - 'X-Goog-Visitor-Id': visitorData, + 'X-Goog-Visitor-Id': context.client.visitorData, 'X-Youtube-Client-Version': context.client.clientVersion, 'X-Youtube-Client-Name': '1' }, @@ -83,8 +82,5 @@ export default async function (videoId, visitorData, context) { const integrityTokenBasedMinter = await BG.WebPoMinter.create({ integrityToken: response[0] }, webPoSignalOutput) - const contentPoToken = await integrityTokenBasedMinter.mintAsWebsafeString(videoId) - const sessionPoToken = await integrityTokenBasedMinter.mintAsWebsafeString(visitorData) - - return { contentPoToken, sessionPoToken } + return await integrityTokenBasedMinter.mintAsWebsafeString(videoId) } diff --git a/src/constants.js b/src/constants.js index 2271764192348..66a2f73751195 100644 --- a/src/constants.js +++ b/src/constants.js @@ -47,7 +47,7 @@ const IpcChannels = { SET_INVIDIOUS_AUTHORIZATION: 'set-invidious-authorization', - GENERATE_PO_TOKENS: 'generate-po-tokens', + GENERATE_PO_TOKEN: 'generate-po-token', WRITE_SCREENSHOT: 'write-screenshot', } diff --git a/src/index.ejs b/src/index.ejs index 7a3aa8aa92971..ecdc7f73fe4b9 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -13,7 +13,7 @@
- <% if (process.env.SUPPORTS_LOCAL_API) { %> + <% if (process.env.IS_ELECTRON) { %> - <% } %> - <% if (!process.env.IS_ELECTRON) { %> + <% } else { %>