add youtube cookie

This commit is contained in:
Jonny_Bro (Nikita) 2024-04-30 12:34:24 +05:00
parent 02990bab63
commit 752171e429
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8
3 changed files with 35 additions and 11 deletions

View file

@ -32,7 +32,15 @@ class JaBaClient extends Client {
this.databaseCache.members = new Collection();
this.databaseCache.usersReminds = new Collection();
this.player = new Player(this);
this.player = new Player(this, {
ytdlOptions: {
requestOptions: {
headers: {
cookie: this.config.youtubeCookie,
},
},
},
});
this.player.extractors.loadDefault(null, {
SpotifyExtractor: {
clientId: this.config.spotify.clientId,

View file

@ -29,7 +29,7 @@
"mongoose": "^7.6.3",
"ms": "^2.1.3",
"node-fetch": "^2.7.0",
"youtube-ext": "^1.1.23"
"ytdl-core": "^4.11.5"
},
"devDependencies": {
"eslint": "^8.56.0"

View file

@ -62,9 +62,9 @@ dependencies:
node-fetch:
specifier: ^2.7.0
version: 2.7.0
youtube-ext:
specifier: ^1.1.23
version: 1.1.23
ytdl-core:
specifier: ^4.11.5
version: 4.11.5
devDependencies:
eslint:
@ -1354,6 +1354,14 @@ packages:
engines: {node: '>=12'}
dev: false
/m3u8stream@0.8.6:
resolution: {integrity: sha512-LZj8kIVf9KCphiHmH7sbFQTVe4tOemb202fWwvJwR9W5ENW/1hxJN6ksAWGhQgSBSa3jyWhnjKU1Fw1GaOdbyA==}
engines: {node: '>=12'}
dependencies:
miniget: 4.2.3
sax: 1.2.4
dev: false
/magic-bytes.js@1.5.0:
resolution: {integrity: sha512-wJkXvutRbNWcc37tt5j1HyOK1nosspdh3dj6LUYYAvF6JYNqs53IfRvK9oEpcwiDA1NdoIi64yAMfdivPeVAyw==}
dev: false
@ -1394,6 +1402,11 @@ packages:
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: false
/miniget@4.2.3:
resolution: {integrity: sha512-SjbDPDICJ1zT+ZvQwK0hUcRY4wxlhhNpHL9nJOB2MEAXRGagTljsO8MEDzQMTFf0Q8g4QNi8P9lEm/g7e+qgzA==}
engines: {node: '>=12'}
dev: false
/minimatch@3.1.2:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
dependencies:
@ -2137,12 +2150,15 @@ packages:
engines: {node: '>=10'}
dev: true
/youtube-ext@1.1.23:
resolution: {integrity: sha512-YqOg3pQONwIZ5OMyLaDzAKmyN4ZsLzhCll20VGL20Z6aakNK6n9hHEdf7Bn3VkGw8/ehub7OpoqepHzBkomk+Q==}
dependencies:
undici: 6.15.0
dev: false
/youtube-sr@4.3.11:
resolution: {integrity: sha512-3oHiS2x7PpMiDRW7Cq8nz1bkAIBOJHoOwkPl/oncM/+A9/3xxMDgMLGW2dsBEP1DHFyRXYTVABgfbdwHF8sXXQ==}
dev: false
/ytdl-core@4.11.5:
resolution: {integrity: sha512-27LwsW4n4nyNviRCO1hmr8Wr5J1wLLMawHCQvH8Fk0hiRqrxuIu028WzbJetiYH28K8XDbeinYW4/wcHQD1EXA==}
engines: {node: '>=12'}
dependencies:
m3u8stream: 0.8.6
miniget: 4.2.3
sax: 1.2.4
dev: false