Hacky Deezer Rich Presence service for Discord, using DBus to fetch playback data from the KDE desktop integration browser extension.
Go to file
2024-05-19 17:51:40 +02:00
app_assets Init commit 2024-05-19 16:57:26 +02:00
assets Init commit 2024-05-19 16:57:26 +02:00
src ooprs 2024-05-19 17:51:40 +02:00
.gitignore Init commit 2024-05-19 16:57:26 +02:00
deezer-rich-presence.service Init commit 2024-05-19 16:57:26 +02:00
LICENSE Init commit 2024-05-19 16:57:26 +02:00
package.json Init commit 2024-05-19 16:57:26 +02:00
pnpm-lock.yaml Init commit 2024-05-19 16:57:26 +02:00
README.md Init commit 2024-05-19 16:57:26 +02:00
tsconfig.json Init commit 2024-05-19 16:57:26 +02:00

Deezer Discord Presence

This script provides Discord Rich Presence for Deezer by fetching playback data from the KDE Browser Integration via DBus.

This is a personal project tailored to my needs, so you will likely have to put in some effort or mess with the source code to get it working. I don't expect anyone else to be interested in using this, but I'm happy to accept issues and pull requests regardless.

Screenshot of the presence widget on my profile

Running

pnpm install # Install dependencies
pnpm run build
pnpm run start

A systemd user service deezer-rich-presence.service is provided, adjust the paths to your nodejs binary and the application directory and copy it to ~/.local/share/systemd/user/.

Since I use Vencord with arrpc (which runs separately from Discord in the background), the service runs fine on my machine while Discord is closed - However, if you use the default Discord client, you will likely see the service crash repeatedly unless Discord is running.
I recommend using Vencord with arrpc instead of the default client as it is better in every regard than the stock client on Linux. Otherwise you'll have to deal with systemd stopping the service when it exits too frequently.

How it works

This is a very specific setup but can easily be adapted to other browsers or software, as long as they provide org.mpris.MediaPlayer2.Player. Simply replace org.kde.plasma.browser_integration in index.ts with the appropriate name (can be found through busctl --user list).
You'll likely want to replace the client ID too if you want to change the application name or artwork. The Rich Presence assets I use are in app_assets/.

Unfortunately, due to limitations with how this data is provided, this is not always reliable, especially when other media is playing in the same browser. For some reason, the length and progress timestamps are messed up too, but the latter usually works well enough™ to still be worth including.
Ideally this information would be collected through a custom browser extension, but as those can't directly connect to IPC, extra complexity involving a separate desktop client would be required.