youtubei.js
Advanced tools
Comparing version 1.4.2-d.8 to 1.4.2-d.9
@@ -17,2 +17,3 @@ 'use strict'; | ||
#api_version; | ||
#remote_host; | ||
#context; | ||
@@ -31,10 +32,11 @@ #player; | ||
const ytcfg = data[0]; | ||
const ytcfg = data[0][0][2]; | ||
this.#key = ytcfg.INNERTUBE_API_KEY; | ||
this.#client_name = ytcfg.INNERTUBE_CLIENT_NAME; | ||
this.#client_version = ytcfg.INNERTUBE_CLIENT_VERSION; | ||
this.#api_version = ytcfg.INNERTUBE_API_VERSION; | ||
this.#key = ytcfg[1]; | ||
this.#api_version = `v${ytcfg[0][0][6]}`; | ||
this.#client_name = Constants.CLIENTS.WEB.NAME; | ||
this.#client_version = ytcfg[0][0][16]; | ||
this.#remote_host = ytcfg[0][0][3]; | ||
this.#player = await new Player(data[1]).init(); | ||
this.#context = this.#buildContext(); | ||
@@ -57,2 +59,3 @@ | ||
gl: this.#config.gl || 'US', | ||
remoteHost: this.#remote_host, | ||
deviceMake: user_agent.vendor, | ||
@@ -74,3 +77,3 @@ deviceModel: user_agent.platform, | ||
async #getYtConfig() { | ||
const response = await Axios.get(`${Constants.URLS.YT_BASE}/sw.js`).catch((err) => err); | ||
const response = await Axios.get(`${Constants.URLS.YT_BASE}/sw.js_data`).catch((err) => err); | ||
@@ -82,4 +85,4 @@ if (response instanceof Error) | ||
}); | ||
return JSON.parse(Utils.getStringBetweenStrings(response.data, 'ytcfg.set(', ')')); | ||
return JSON.parse(response.data.replace(')]}\'', '')); | ||
} | ||
@@ -86,0 +89,0 @@ |
@@ -34,2 +34,5 @@ 'use strict'; | ||
CLIENTS: { | ||
WEB: { | ||
NAME: 'WEB' | ||
}, | ||
YTMUSIC: { | ||
@@ -36,0 +39,0 @@ NAME: 'WEB_REMIX', |
{ | ||
"name": "youtubei.js", | ||
"version": "1.4.2-d.8", | ||
"version": "1.4.2-d.9", | ||
"description": "A full-featured library that allows you to get detailed info about any video, subscribe, unsubscribe, like, dislike, comment, search, download videos/music and much more!", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,3 @@ 'use strict'; | ||
describe("YouTube.js Tests", () => { | ||
describe('YouTube.js Tests', () => { | ||
beforeAll(async () => { | ||
@@ -12,0 +12,0 @@ this.session = await new Innertube(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
308873
7780