Star ✨ on GitHub

DeezerSource

API reference for the DeezerSource in Moonlink.js

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.

Properties

PropertyTypeDescription
namestringThe name of the source: Deezer.

Methods

match

matchmethod

Match URL

Checks if a given URL or query string matches a Deezer track, album, playlist, or artist URL, or a dzsearch: query.

Parameters
queryrequiredstring
The URL or query string to check.

Returns & Example

Returnsbooleantrue if the query matches a Deezer pattern, false otherwise.

const isDeezerLink = source.match('https://deezer.com/track/12345');

::

searchmethod

Search Deezer

Searches for tracks on Deezer based on a query. Results are limited by manager.options.deezer.maxSearchResults.

Parameters
queryrequiredstring
The search query (e.g., dzsearch:song title).

Returns & Example

ReturnsPromise<any> — A search result object containing loadType and data.

const results = await source.search('dzsearch:Never Gonna Give You Up');

load

loadmethod

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
queryrequiredstring
The Deezer URL to load.

Returns & Example

ReturnsPromise<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

resolvemethod

Resolve Deezer Content

Resolves Deezer content from a URL. This method is an alias for load.

Parameters
queryrequiredstring
The Deezer URL to resolve.

Returns & Example

ReturnsPromise<any> — A load result object.

const resolvedTrack = await source.resolve('https://deezer.com/track/12345');