discord-player-deezer 2.5.0-beta.0 → 2.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -154,7 +154,7 @@ async function streamTrack(track, ext) {
154
154
  const trackInfoRes = await ext.fetch(`https://www.deezer.com/ajax/gw-light.php?method=song.getListData&input=3&api_version=1.0&api_token=${ext.userInfo.csrfToken}`, {
155
155
  method: "POST",
156
156
  headers: {
157
- Cookie: ext.userInfo.cookie,
157
+ Cookie: `${ext.userInfo.cookie}; arl=${ext.options.arl}`,
158
158
  "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
159
159
  "DNT": "1"
160
160
  },
@@ -264,18 +264,17 @@ async function fetchDeezerUser(ext) {
264
264
  }
265
265
  var DeezerExtractor = class extends import_discord_player2.BaseExtractor {
266
266
  async fetch(input, options) {
267
- return fetch(input, {
268
- ...options,
269
- headers: {
270
- ...options?.headers,
271
- Cookie: parseCookie({ arl: this.options.arl }),
272
- "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
273
- "DNT": "1",
274
- "Origin": "https://www.deezer.com",
275
- "Connection": "keep-alive",
276
- "Referer": "https://www.deezer.com/login"
277
- }
278
- });
267
+ if (!options) options = {};
268
+ options.headers = {
269
+ Cookie: parseCookie({ arl: this.options.arl }),
270
+ "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
271
+ "DNT": "1",
272
+ "Origin": "https://www.deezer.com",
273
+ "Connection": "keep-alive",
274
+ "Referer": "https://www.deezer.com/login",
275
+ ...options?.headers
276
+ };
277
+ return fetch(input, options);
279
278
  }
280
279
  async activate() {
281
280
  this.protocols = ["deezer"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discord-player-deezer",
3
- "version": "2.5.0-beta.0",
3
+ "version": "2.5.0-beta.1",
4
4
  "description": "A custom extractor made for discord-player that enables you to extract from Deezer.",
5
5
  "main": "dist/index.js",
6
6
  "author": "retro_ig",
@@ -75,18 +75,17 @@ export class DeezerExtractor extends BaseExtractor<DeezerExtractorOptions> {
75
75
  __interval?: ReturnType<typeof setInterval>
76
76
 
77
77
  async fetch(input: Parameters<typeof fetch>[0], options?: Parameters<typeof fetch>[1]) {
78
- return fetch(input, {
79
- ...options,
80
- headers: {
81
- ...options?.headers,
82
- Cookie: parseCookie({ arl: this.options.arl }),
83
- 'User-Agent': "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
84
- 'DNT': '1',
85
- "Origin": "https://www.deezer.com",
86
- 'Connection': 'keep-alive',
87
- 'Referer': 'https://www.deezer.com/login'
88
- }
89
- })
78
+ if(!options) options = {}
79
+ options.headers = {
80
+ Cookie: parseCookie({ arl: this.options.arl }),
81
+ 'User-Agent': "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
82
+ 'DNT': '1',
83
+ "Origin": "https://www.deezer.com",
84
+ 'Connection': 'keep-alive',
85
+ 'Referer': 'https://www.deezer.com/login',
86
+ ...options?.headers,
87
+ }
88
+ return fetch(input, options)
90
89
  }
91
90
 
92
91
  async activate(): Promise<void> {
package/src/utils/util.ts CHANGED
@@ -120,7 +120,7 @@ export async function streamTrack(track: Track, ext: DeezerExtractor) {
120
120
  const trackInfoRes = await ext.fetch(`https://www.deezer.com/ajax/gw-light.php?method=song.getListData&input=3&api_version=1.0&api_token=${ext.userInfo.csrfToken}`, {
121
121
  method: "POST",
122
122
  headers: {
123
- Cookie: ext.userInfo.cookie,
123
+ Cookie: `${ext.userInfo.cookie}; arl=${ext.options.arl}`,
124
124
  'User-Agent': "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
125
125
  'DNT': '1'
126
126
  },