diff --git a/src/core/Actions.ts b/src/core/Actions.ts index 0ecf2293..025ecb52 100644 --- a/src/core/Actions.ts +++ b/src/core/Actions.ts @@ -64,11 +64,11 @@ class Actions { /** * Mimmics the Axios API using Fetch's Response object. */ - async #wrap(response: Response, protobuf?: boolean) { + async #wrap(response: Response) { return { success: response.ok, status_code: response.status, - data: protobuf ? await response.text() : JSON.parse(await response.text()) + data: JSON.parse(await response.text()) }; } @@ -776,7 +776,7 @@ class Actions { return Parser.parseResponse(await response.json()); } - return this.#wrap(response, args.protobuf); + return this.#wrap(response); } #needsLogin(id: string) { diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index a44df15a..83c93324 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -6,7 +6,8 @@ export const URLS = Object.freeze({ YT_UPLOAD: 'https://upload.youtube.com/', API: Object.freeze({ BASE: 'https://youtubei.googleapis.com', - PRODUCTION: 'https://youtubei.googleapis.com/youtubei/', + PRODUCTION_1: 'https://www.youtube.com/youtubei/', + PRODUCTION_2: 'https://youtubei.googleapis.com/youtubei/', STAGING: 'https://green-youtubei.sandbox.googleapis.com/youtubei/', RELEASE: 'https://release-youtubei.sandbox.googleapis.com/youtubei/', TEST: 'https://test-youtubei.sandbox.googleapis.com/youtubei/', diff --git a/src/utils/HTTPClient.ts b/src/utils/HTTPClient.ts index 6d7b083a..3c26f0c6 100644 --- a/src/utils/HTTPClient.ts +++ b/src/utils/HTTPClient.ts @@ -27,7 +27,7 @@ export default class HTTPClient { input: URL | Request | string, init?: RequestInit & HTTPClientInit ) { - const innertube_url = Constants.URLS.API.PRODUCTION + this.#session.api_version; + const innertube_url = Constants.URLS.API.PRODUCTION_1 + this.#session.api_version; const baseURL = init?.baseURL || innertube_url; const request_url =