Deezer

new Deezer(arlopt) → {Object}

Constructs the Deezer class.
Parameters:
NameTypeAttributesDescription
arlstring<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:
NameTypeDescription
methodstringThe Deezer API method
bodyObjectThe JSON body
Returns:
The response
Type: 
Promise.<Object>

(async) get(idOrURL, typeopt) → {Promise.<(Entity|null)>}

Gets an entity by ID or URL.
Parameters:
NameTypeAttributesDescription
idOrURLstringThe entity ID or URL
typeEntityType<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:
NameTypeAttributesDefaultDescription
trackObjectThe track object
flacboolean<optional>
falseWhether to get the track in FLAC. Only works for Deezer Premium accounts
Returns:
The decrypted track buffer
Type: 
Promise.<Buffer>
Searches for entities.
Parameters:
NameTypeAttributesDefaultDescription
querystringThe query
typeEntityType<optional>
"track"The entity type
Returns:
An array of search results, depending on the entity type
Type: 
Promise.<Array>