discord-player-deezer 2.0.0-beta.3 → 2.0.0-beta.4

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -195,15 +195,17 @@ var DeezerExtractor = class extends import_discord_player2.BaseExtractor {
195
195
  const randomToken = crypto.randomBytes(16).toString("hex");
196
196
  const deezerUsrDataUrl = `https://www.deezer.com/ajax/gw-light.php?method=deezer.getUserData&input=3&api_version=1.0&api_token=${randomToken}`;
197
197
  const usrDataRes = await fetch(deezerUsrDataUrl);
198
- const cookie = usrDataRes.headers.get("set-cookie");
199
- this.userInfo.cookie = cookie;
200
198
  const usrData = await usrDataRes.json();
201
199
  const licenseToken = usrData.results.USER.OPTIONS.license_token;
202
200
  if (typeof licenseToken !== "string") throw new Error("Unable to get licenseToken");
203
- this.userInfo.licenseToken = licenseToken;
204
201
  const csrfToken = usrData.results.checkForm;
205
202
  if (typeof csrfToken !== "string") throw new Error("Unable to get csrf token which is required for decryption");
206
- this.userInfo.mediaUrl = usrData.results.URL_MEDIA || "https://media.deezer.com";
203
+ this.userInfo = {
204
+ mediaUrl: usrData.results.URL_MEDIA || "https://media.deezer.com",
205
+ cookie: usrDataRes.headers.get("set-cookie"),
206
+ licenseToken,
207
+ csrfToken
208
+ };
207
209
  }
208
210
  }
209
211
  async validate(query) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discord-player-deezer",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.0-beta.4",
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",