From 69f73ff09fd66d77245325e4a566371affd9a39d Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Tue, 17 Jun 2025 15:16:13 +0000 Subject: [PATCH] docs(deezer): Rewrite Deezer Source with ARL implementation * Add ARL implementation docs and warnings * Update json examples to include both types of deezer configs --- README.md | 2 +- config/deezer-deprecated.json.example | 13 ++ config/deezer.json.example | 7 +- docsite/docs/configuration/configuration.mdx | 179 ++++++++++++++----- docsite/src/pages/index.mdx | 2 +- src/backend/sources/DeezerSource.ts | 2 +- 6 files changed, 157 insertions(+), 48 deletions(-) create mode 100644 config/deezer-deprecated.json.example diff --git a/README.md b/README.md index d6014daa..e408d541 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c * [ListenBrainz](https://foxxmd.github.io/multi-scrobbler/docs/configuration#listenbrainz-source) * [Koito](https://foxxmd.github.io/multi-scrobbler/docs/configuration#listenbrainz-source) using Listenbrainz Source * [ListenBrainz (Endpoint)](https://foxxmd.github.io/multi-scrobbler/docs/configuration#listenbrainz-endpoint) - * [~~Deezer~~](https://foxxmd.github.io/multi-scrobbler/docs/configuration#deezer) + * [Deezer](https://foxxmd.github.io/multi-scrobbler/docs/configuration#deezer) * [MPRIS (Linux Desktop)](https://foxxmd.github.io/multi-scrobbler/docs/configuration#mpris) * [Mopidy](https://foxxmd.github.io/multi-scrobbler/docs/configuration#mopidy) * [JRiver](https://foxxmd.github.io/multi-scrobbler/docs/configuration#jriver) diff --git a/config/deezer-deprecated.json.example b/config/deezer-deprecated.json.example new file mode 100644 index 00000000..4271ed73 --- /dev/null +++ b/config/deezer-deprecated.json.example @@ -0,0 +1,13 @@ +[ + { + "name": "DeezerOfficalDeprecated", + "enable": true, + "clients": [], + "data": { + "clientId": "a89cba1569901a0671d5a9875fed4be1", + "clientSecret": "ec42e09d5ae0ee0f0816ca151008412a", + "redirectUri": "http://localhost:9078/deezer/callback", + "interval": 60 + } + } +] diff --git a/config/deezer.json.example b/config/deezer.json.example index 6d2664a8..8ffdac08 100644 --- a/config/deezer.json.example +++ b/config/deezer.json.example @@ -1,13 +1,10 @@ [ { - "name": "FoxxMDeezer", + "name": "DeezerARL", "enable": true, "clients": [], "data": { - "clientId": "a89cba1569901a0671d5a9875fed4be1", - "clientSecret": "ec42e09d5ae0ee0f0816ca151008412a", - "redirectUri": "http://localhost:9078/deezer/callback", - "interval": 60 + "arl": "UOsRPjT3U5Dhaaup3xQ30DWFoSgqugdSYzL3QE743waaVy2eur2ckyJcZ4RV123Q3PsbKXkLwA6ahc9XmEfev6BtfSP8LujE3JswWRQogZCDUOwVzWO5sAig", } } ] diff --git a/docsite/docs/configuration/configuration.mdx b/docsite/docs/configuration/configuration.mdx index 8c204a09..01613e60 100644 --- a/docsite/docs/configuration/configuration.mdx +++ b/docsite/docs/configuration/configuration.mdx @@ -12,7 +12,8 @@ import AIOExample from "../../src/components/AIOExample"; import AIOConfig from '!!raw-loader!../../../config/config.json.example'; import AzuracastConfig from '!!raw-loader!../../../config/azuracast.json.example'; import ChromecastConfig from '!!raw-loader!../../../config/chromecast.json.example'; -import DeezerConfig from '!!raw-loader!../../../config/chromecast.json.example'; +import DeezerConfig from '!!raw-loader!../../../config/deezer.json.example'; +import DeezerDeprecatedConfig from '!!raw-loader!../../../config/deezer-deprecated.json.example'; import IcecastConfig from '!!raw-loader!../../../config/icecast.json.example'; import JellyfinConfig from '!!raw-loader!../../../config/jellyfin.json.example'; import JriverfinConfig from '!!raw-loader!../../../config/jriver.json.example'; @@ -872,72 +873,170 @@ Most Listenbrainz clients require a token (Authentication Token) to be provided -### [~~Deezer~~](https://deezer.com/) +### [Deezer](https://deezer.com/) -:::warning + + + :::warning -**This Source is DEPRECATED because Deezer has dropped official API support.** This Source will **not** be removed but no further support or fixes will be given. + This Source uses unofficial methods to access Deezer data that are likely in violation of Deezer's TOS. Deezer may change or remove these methods at any time, breaking functionality. Use this Source at your own risk. -Users cannot create new applications on Deezer Developers and there is no guarantee existing applications will continue to work. + ::: -As a workaround consider integrating Deezer with last.fm and then using [last.fm as a Source](#lastfm-source). + :::info -Users with existing Deezer applications in use with multi-scrobbler should consider this change as well to avoid future breaking issues with the unsupported API. + This Source will work only if you have a **Premium** Deezer account. -[See this issue for more discussion.](https://github.com/FoxxMD/multi-scrobbler/issues/175#issuecomment-2296776625) + ::: -::: + ##### Retrieve ARL -Create a new application at [Deezer Developers](https://developers.deezer.com/myapps) + The `arl` is a browser cookie that Deezer uses to store your login information. Multi-scrobbler uses the `arl` value to make authorized requests to Deezer's API where it can retrieve listening history. -* Application Domain must be the same as your multi-scrobbler domain. Default is `localhost:9078` -* Redirect URL must end in `deezer/callback` - * Default would be `http://localhost:9078/deezer/callback` + **After logging into Deezer**, use one of the methods below to retrieve the `arl` cookie value: -After application creation you should have credentials displayed in the "My Apps" dashboard. You will need: + + + 1. On deezer.com, press F12 to open the Developer Tools window. + 2. Go to the Applications tab. Press the '>>' More tabs icon if it's hidden. + 3. Under the Cookies Filter, click deezer.com, then the text bar name `arl`. + 4. Copy all the contents shown in the **Cookie Value** pane. + + + 1. On deezer.com, hit Ctrl+Shift+I to open Developer Tools + 2. Go to the Storage Tab, then expand Cookies in the sidebar and select deezer.com + 3. Find the row with `arl` as the name, then double click the Value column and right click -> copy the value + + -* **Application ID** -* **Secret Key** -* **Redirect URL** (if not the default) + #### Configuration -**If no access token is provided...** + + + | Environmental Variable | Required? | Default | Description | + | :--------------------- | --------- | ------- | ------------------------------------------------ | + | `DEEZER_ARL` | Yes | | The ARL cookie value retrieved from your browser | + + +
-After starting multi-scrobbler with credentials in-place open the dashboard (`http://localhost:9078`) and find your Deezer source. Click **(Re)authenticate and (re)start polling** to start the login process. After login is complete polling will begin automatically. + Example -#### Configuration + {DeezerConfig} - - - | Environmental Variable | Required? | Default | Description | - |------------------------|-----------|-----------------------------------------|-----------------------------------| - | `DEEZER_CLIENT_ID` | Yes | | Your **Application ID** | - | `DEEZER_CLIENT_SECRET` | Yes | | Your **Secret Key** | - | `DEEZER_REDIRECT_URI` | No | `http://localhost:9078/deezer/callback` | URI must end in `deezer/callback` | - - -
+
- Example + or +
+ +
- {DeezerConfig} + Example -
+ - or -
- -
+
- Example + or +
+
+ + + ##### Duplicate detection + + Third party integrations with Deezer (Sonos) may cause Deezer to [report the same track many times in listening history.](https://github.com/FoxxMD/multi-scrobbler/pull/296#issuecomment-2922374738) If you experience this issue modify your Deezer Source config (file-based only) to include the option `"fuzzyDiscoveryIgnore": "aggressive"` - +
+ + deezer.json example + ```json title="deezer.json" + [ + { + "name": "MyDeezer", + "data": { + "arl": "UOsRPjT3U5Dhaaup3x...", + }, + "options": { + "fuzzyDiscoveryIgnore": "aggressive" + } + } + ] + ```
- or + This option comes with some trade-offs: MS will aggressively detect repeated tracks within a window of time that should eliminate all duplicates. However, this will also prevent *intentionally* repeated tracks from being scrobbled. See [this thread](https://github.com/FoxxMD/multi-scrobbler/pull/296#issuecomment-2970417070) for more information on how this works. + + + + :::warning + + **This Source is DEPRECATED because Deezer has dropped official API support.** This Source will **not** be removed but no further support or fixes will be given. [See this issue for more discussion.](https://github.com/FoxxMD/multi-scrobbler/issues/175#issuecomment-2296776625) + + Users cannot create new applications on Deezer Developers and there is no guarantee existing applications will continue to work. + + As a workaround consider: + + * Using the alternative [Deezer Source that uses unofficial, internal API via ARL](./?deezerSource=arl#deezer) + * Connect Deezer with Last.fm and then use [Last.fm as a Source](#lastfm-source) + + ::: + + Create a new application at [Deezer Developers](https://developers.deezer.com/myapps) + + * Application Domain must be the same as your multi-scrobbler domain. Default is `localhost:9078` + * Redirect URL must end in `deezer/callback` + * Default would be `http://localhost:9078/deezer/callback` + + After application creation you should have credentials displayed in the "My Apps" dashboard. You will need: + + * **Application ID** + * **Secret Key** + * **Redirect URL** (if not the default) + + **If no access token is provided...** + + After starting multi-scrobbler with credentials in-place open the dashboard (`http://localhost:9078`) and find your Deezer source. Click **(Re)authenticate and (re)start polling** to start the login process. After login is complete polling will begin automatically. + + #### Configuration + + + + | Environmental Variable | Required? | Default | Description | + |------------------------|-----------|-----------------------------------------|-----------------------------------| + | `DEEZER_CLIENT_ID` | Yes | | Your **Application ID** | + | `DEEZER_CLIENT_SECRET` | Yes | | Your **Secret Key** | + | `DEEZER_REDIRECT_URI` | No | `http://localhost:9078/deezer/callback` | URI must end in `deezer/callback` | + + +
+ + Example + + {DeezerDeprecatedConfig} + +
+ + or +
+ +
+ + Example + + + +
+ + or +
+
+ +
+ ### [Youtube Music](https://music.youtube.com) :::warning diff --git a/docsite/src/pages/index.mdx b/docsite/src/pages/index.mdx index bcdcb1e6..735b379b 100644 --- a/docsite/src/pages/index.mdx +++ b/docsite/src/pages/index.mdx @@ -24,7 +24,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c * [ListenBrainz](docs/configuration#listenbrainz-source) * [Koito](docs/configuration#listenbrainz-source) using Listenbrainz Source * [ListenBrainz (Endpoint)](docs/configuration#listenbrainz-endpoint) - * [~~Deezer~~](docs/configuration#deezer) + * [Deezer](docs/configuration#deezer) * [MPRIS (Linux Desktop)](docs/configuration#mpris) * [Mopidy](docs/configuration#mopidy) * [JRiver](docs/configuration#jriver) diff --git a/src/backend/sources/DeezerSource.ts b/src/backend/sources/DeezerSource.ts index 022a735f..dc7ecd05 100644 --- a/src/backend/sources/DeezerSource.ts +++ b/src/backend/sources/DeezerSource.ts @@ -91,7 +91,7 @@ export default class DeezerSource extends AbstractSource { } protected async doBuildInitData(): Promise { - this.logger.warn('This Source is DEPRECATED! Deezer has dropped support official API support. New apps cannot be created and existing apps are not guaranteed to continue working. See the documentation or this issue for more information: https://github.com/FoxxMD/multi-scrobbler/issues/175#issuecomment-2296776625'); + this.logger.warn('This Source is DEPRECATED! Deezer has dropped support official API support. New apps cannot be created and existing apps are not guaranteed to continue working. Refer to the MS documentation for a new Deezer Source implementation.'); try { const credFile = await readJson(this.workingCredsPath, {throwOnNotFound: false}); -- 2.51.2