Discord Rich Presence for Plexamp is a Python script that displays your Plex status on Discord using Rich Presence.
- Install Python - Make sure to tick "Add Python 3.XX to PATH" during the installation.
- Download this repository's contents.
- Extract the folder contained in the above ZIP file.
- Launch the
start.bat
file. - Install the required Python modules by running
pip install -U -r requirements.txt
. - Start the script by running
python main.py
.
When the script runs for the first time, a config.json
file will be created in the working directory and you will be prompted to complete the authentication flow to allow the script to retrieve an access token for your Plex account.
The script must be running on the same machine as your Discord client.
logging
debug
(boolean, default:true
) - Outputs additional debug-helpful information to the console if enabled.writeToFile
(boolean, default:false
) - Writes everything outputted to the console to aconsole.log
file if enabled.
display
- Display settings for Rich PresencehideTotalTime
(boolean, default:false
) - Hides the total duration of the media if enabled.useRemainingTime
(boolean, default:false
) - Displays the media's remaining time instead of elapsed time if enabled.posters
enabled
(boolean, default:false
) - Uses cover-uploady to display a cover art. Requires setup of the two variables below. See usage.cuDomain
(string, default:""
) - Domain that cover-uploady is hosted on. The/upload
and/cover.jpg
endpoints are automatically appended when required, don't worry.cuSecret
(string, default:""
) - Cover-uploady's secret passphrase for uploads. See below.
buttons
(list) - Informationlabel
(string) - The label to be displayed on the button.url
(string) - A web address or a dynamic URL placeholder.
users
(list)token
(string) - An access token associated with your Plex account. (X-Plex-Token, Authenticating with Plex)servers
(list)name
(string) - Name of the Plex Media Server you wish to connect to.listenForUser
(string, optional) - The script will respond to alerts originating only from this username. Defaults to the parent user's username if not set.blacklistedLibraries
(list, optional) - Alerts originating from libraries in this list are ignored.whitelistedLibraries
(list, optional) - If set, alerts originating from libraries that are not in this list are ignored.
This fork uses a microservice called cover-uploady to display the cover art image. This service should be self-hosted and is for advanced users. Sorry. The original fork spammed Imgur's API and that, honestly, was worse.
- Install cover-uploady.
- When writing the .env file, write a SECRET string. It can be whatever you want and however long or short you want, but longer is better, I keep mine at 32 chars.
- Copy the SECRET and insert it into
cuSecret
in theconfig.json
file. - Copy the domain that the microservice is hosted on (like
cover.vlnx.ru
in my case) to thecuDomain
variable. - Don't forget to switch
display.posters.enabled
totrue
!
Discord can display up to 2 buttons in your Rich Presence.
Due to a strange Discord bug, these buttons are unresponsive or exhibit strange behaviour towards your own clicks, but other users are able to click on them to open their corresponding URLs. (citation needed)
Please don't abuse this as another funny field. Link to something worthwhile, don't just use it as an extra place to post your whatever.
During runtime, the following dynamic URL placeholders will get replaced with real URLs based on the media being played:
dynamic:imdb
dynamic:tmdb
{
"logging": {
"debug": true,
"writeToFile": false
},
"display": {
"hideTotalTime": false,
"useRemainingTime": false,
"posters": {
"enabled": true,
"cuDomain": "cover.example.com",
"cuSecret": "9e9sf637S8bRp4z"
},
"buttons": [
{
"label": "IMDb Link",
"url": "dynamic:imdb"
},
{
"label": "My YouTube Channel",
"url": "https://www.youtube.com/channel/me"
}
]
},
"users": [
{
"token": "HPbrz2NhfLRjU888Rrdt",
"servers": [
{
"name": "Bob's Home Media Server"
},
{
"name": "A Friend's Server",
"listenForUser": "xyz",
"whitelistedLibraries": ["Movies"]
}
]
}
]
}
The "Display current activity as a status message" setting must be enabled in Discord Settings → Activity Settings → Activity Privacy.