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 +12 -13
- package/package.json +1 -1
- package/src/DeezerExtractor.ts +11 -12
- package/src/utils/util.ts +1 -1
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
package/src/DeezerExtractor.ts
CHANGED
|
@@ -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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
},
|