DeezerSource Class
The DeezerSource
provides integration with the Deezer API, allowing Moonlink.js to search for and load tracks, albums, playlists, and artists from Deezer. It handles authentication and API requests internally.
This source is automatically loaded if disableNativeSources
is not set to true
in the Manager options.
Properties
Property | Type | Description |
---|---|---|
name | string | The name of the source: Deezer . |
Methods
match
Match URL
Checks if a given URL or query string matches a Deezer track, album, playlist, or artist URL, or a dzsearch:
query.
Parameters
Returns & Example
Returns
• boolean
— true
if the query matches a Deezer pattern, false
otherwise.
const isDeezerLink = source.match('https://deezer.com/track/12345');
::
search
Search Deezer
Searches for tracks on Deezer based on a query. Results are limited by manager.options.deezer.maxSearchResults
.
Parameters
dzsearch:song title
). Returns & Example
Returns
• Promise<any>
— A search result object containing loadType
and data
.
const results = await source.search('dzsearch:Never Gonna Give You Up');
load
Load Deezer Content
Loads content from a Deezer URL (track, album, playlist, artist). Handles short links and limits results based on manager.options.deezer
configurations.
Parameters
Returns & Example
Returns
• Promise<any>
— A load result object containing loadType
and data
.
const track = await source.load('https://deezer.com/track/12345');
const playlist = await source.load('https://deezer.com/playlist/67890');
resolve
Resolve Deezer Content
Resolves Deezer content from a URL. This method is an alias for load
.
Parameters
Returns & Example
Returns
• Promise<any>
— A load result object.
const resolvedTrack = await source.resolve('https://deezer.com/track/12345');