new Deezer(arlopt) → {Object}
Constructs the Deezer class.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arl | string | <optional> | The Deezer ARL cookie, for authenticating as a Deezer Premium account |
Returns:
The Deezer class instance
- Type:
- Object
Methods
(async) api(method, body) → {Promise.<Object>}
Does a request to the Deezer API.
Parameters:
Name | Type | Description |
---|---|---|
method | string | The Deezer API method |
body | Object | The JSON body |
Returns:
The response
- Type:
- Promise.<Object>
(async) get(idOrURL, typeopt) → {Promise.<(Entity|null)>}
Gets an entity by ID or URL.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
idOrURL | string | The entity ID or URL | |
type | EntityType | <optional> | The entity type |
Returns:
The Entity object, or null if no entity was found
- Type:
- Promise.<(Entity|null)>
(async) getAndDecryptTrack(track, flacopt) → {Promise.<Buffer>}
Gets a track buffer and decrypts it. By default, the track is in MP3.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
track | Object | The track object | ||
flac | boolean | <optional> | false | Whether to get the track in FLAC. Only works for Deezer Premium accounts |
Returns:
The decrypted track buffer
- Type:
- Promise.<Buffer>
(async) search(query, typeopt) → {Promise.<Array>}
Searches for entities.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
query | string | The query | ||
type | EntityType | <optional> | "track" | The entity type |
Returns:
An array of search results, depending on the entity type
- Type:
- Promise.<Array>