Skip to main content

Discord (App)

This scrobbler uses Now Playing functionality to set your Discord Rich Presence to the music you are currently monitoring with multi-scrobbler.

This integration uses an existing Discord application to set your Rich Presence.

tip

Check the main Discord docs page for a comparison between App and Headless.

Required Setup

Discord Application

You must create a Discord App in order to use this integration. Creating an App is free and simple.

Go to the Discord Developer Portal

  • Click on "New Application" and give it a name
  • Copy the Application Id (Client Id) shown after creation
  • Add this Id to your Multi-Scrobbler config
    • Env Config => DISCORD_APPLICATION_ID=12345678
    • File Config => "applicationId": "12345678"

Discord Connection

This integration uses an existing, running Discord application to communicate with Discord and set Rich Presence. Multi-scrobbler must be able to communicate with the Discord application, either by being on the same machine or over a network.

Kasm Workspaces provides a self-hostable Discord container image. This image provides a desktop-like experience, through browser-based VNC, to use the official Discord application.

This containerized approach can be used instead of configuring MS to use a Native Discord application on a specific machine.

Advantages

  • Setup is much simpler
    • Discord runs in the same stack as multi-scrobbler
    • Configuration is copy-paste. Skip all of the Discord Connection instructions.
  • Get a Headless-like experience without needing to break Discord TOS

Disadvantages

  • Image only available for x86 arch
  • Image and container are large (1GB+)
  • Discord does not notify other clients of notifications in a channel if any client is viewing that channel.
    • To avoid this, make sure your container discord instance is not viewing any server/channel/dm.
  • Sometimes, Discord does not deliver "notifications you missed" to mobile because this depends on all clients being offline.

Setup

Setup is basically the same as using the instructions for Discord on Linux with MS on Same Host (Docker).

1. Add Discord Service to Multi-Scrobbler Docker Compose Stack

Detailed Explanation
  • Add the kasmweb/discord service to your compose stack
    • Mount the directory containing Discord's unix socket to a named volume
  • Configure MS to use Discord's unix socket
    • Mount the unix socket volume into MS's container
    • Add ENV DISCORD_IPC_LOCATIONS to point to the mounted volume

Use this example docker-compose.yaml to modify your existing multi-scrobbler docker-compose.yaml:

Example
docker-compose.yaml
services:
multi-scrobbler:
image: foxxmd/multi-scrobbler:latest
environment:
# ...
- DISCORD_APPLICATION_ID=12345678
# add below line
- DISCORD_IPC_LOCATIONS=/run/discord-ipc-0
volumes:
# ...
# add below line
- kasm_run:/run
# ...

# .. add discord service below
kasmcord:
container_name: kasmcord
image: kasmweb/discord:1.14.0
ports:
# VNC port to use in web browser
- 6901:6901
shm_size: 512m
environment:
# set a password for VNC access
VNC_PW: hunter2
XDG_RUNTIME_DIR: /run/user/1000
volumes:
- kasm_run:/run/user/1000
- kasm_config:/home/kasm-user/.config
user: "0"
entrypoint: sh -c "chmod 700 /run/user/1000 && chown -R kasm-user:kasm-user /run/user/1000 && chown -R kasm-user:kasm-user /home/kasm-user/.config && su kasm-user -c '/dockerstartup/kasm_default_profile.sh /dockerstartup/vnc_startup.sh /dockerstartup/kasm_startup.sh'"

volumes:
kasm_run:
name: kasm_run
kasm_config:
name: kasm_config

Then re-deploy your stack.

2. Login to Discord

Navigate in your browser to the IP/host Multi-Scrobbler/Discord are running on. Use the port set in the kasmcord service:

# basic auth login
# user: kasm_user
# pass is what was set in env VNC_PW
https://192.168.MY.HOST:6901

Login to Discord normally. After login is complete MS should connect automatically when a Now Playing event happens. If it does not or reports authentication failure then restart MS (but not Discord).

If MS works then you are done and can move on to Optional Setup.

Optional Setup

note

Due to the limitations of the Discord local API the other listening activity detection and online status customizations found in Headless are not available for the Local integration.

Artwork

Multi-scrobbler can display Album Art in your Discord status. The image that is used differs based on if the image URL is publically accessible.

The order in which multi-scrobbler determines what image to use is the same as the order of the tabs shown below.

Artwork URL Types

MS can use external URLs for artwork.

External URLs that are not from known music services are disabled by default. This is to preserve your privacy because Discord does not host images, it only links to them and the URL is visible to other users.

Why Should I Care?

There are some scenarios where you may not want your artwork URLs to be visible, for example:

  • A Source may be accessible only on your LAN (Jellyfin at http://192.168.0.101)
  • A Source may be internet-facing but you do not want to expose this information to discord/other users
  • A Source may be internet-facing but requires authentication to view the image

MS will use your artwork URLs only if:

  • artwork url is from a known music service/Cover Art Archive or
  • artwork url starts with https and
    • artwork (DISCORD_ARTWORK) is
    • true => always uses the url
    • a list of custom domains keywords an external artwork url should contain EX
      • ENV => DISCORD_ARTWORK=mycdn,jellyfin
      • File Config => "artwork": ["mycdn","jellyfin"]
Examples

None of the below URLs will ever be used because they are not https

http://foobar.com/cool.jpg <-- NOT allowed, not http
http://192.168.0.112/fun.png <-- NOT allowed, not http

When DISCORD_ARTWORK is not set:

https://archive.org/download/dir/myimage.jpg <-- allowed, is https and known service
https://spotify.com/assets/cover.png?size=1000 <-- allowed, is https and known service
https://example.com/cool.jpg <-- NOT allowed, is https but not a known service and DISCORD_ARTWORK is not set
https://anything.com/neat.jpg <-- NOT allowed, is https but not a known service and DISCORD_ARTWORK is not set

Setting DISCORD_ARTWORK=true

https://archive.org/my/dir/myimage.jpg <-- allowed, is https and known service
http://foobar.com/cool.jpg <-- NOT allowed, not http
https://example.com/cool.jpg <-- allowed, is https
https://anything.com/neat.jpg <-- allowed, is https

Setting DISCORD_ARTWORK=mycdn,jellyfin

https://archive.org/my/dir/myimage.jpg <-- allowed, is https and known service
http://foobar.com/cool.jpg <-- NOT allowed, not http
https://example.com/cool.jpg <-- NOT allowed, is https but does not contain "mycdn" or "jellyfin"
https://jellyfin.mydomain.com/neat.jpg <-- allowed, is https and contains "jellyfin"

Configuration

ENV Config Type

Environmental VariableRequired?DefaultDescription
DISCORD_APPLICATION_IDYesApplication ID
DISCORD_IPC_LOCATIONSNoA commera-separated list of host:port network locations or file paths to unix socket for Discord
DISCORD_ARTWORKNoA boolean indicating if external artwork URLs should be used. Or a comma-separated list of allowed domains
DISCORD_ARTWORK_DEFAULT_URLNoA URL of an image to use as a fallback if the album art URL cannot be used. Or false to use discord's default.