A Python script that displays your Plex status on Discord using Rich Presence.
- Python 3.6.7
- plexapi
- Use websocket-client version 0.48.0 (
pip install websocket-client==0.48.0
) as an issue with newer versions breaks the plexapi module's alert listener. - The script must be running on the same machine as your Discord client.
Add your configuration(s) into the plexConfigs
list on line 30.
plexConfigs = [
plexConfig(serverName = "ABC", username = "xyz", password = "0tYD4UIC4Tb8X0nt"),
plexConfig(serverName = "DEF", username = "[email protected]", token = "70iU3GZrI54S76Tn", listenForUser = "xyz"),
plexConfig(serverName = "GHI", username = "xyz", password = "0tYD4UIC4Tb8X0nt", blacklistedLibraries = ["TV Shows", "Music"])
]
serverName
- Name of the Plex Media Server to connect to.username
- Your account's username or e-mail.password
(not required iftoken
is set) - The password associated with the above account.token
(not required ifpassword
is set) - A X-Plex-Token associated with the above account. In some cases,myPlexAccessToken
from Plex Web App's HTML5 Local Storage must be used. To retrieve this token in Google Chrome, open Plex Web App, press F12, go to "Application", expand "Local Storage" and select the relevant entry. Ignorespassword
if set.listenForUser
(optional) - The script will respond to alerts originating only from this username. Defaults tousername
if not set.blacklistedLibraries
(list, optional) - Alerts originating from blacklisted libraries are ignored.whitelistedLibraries
(list, optional) - If set, alerts originating from libraries that are not in the whitelist are ignored.
- Line 16:
extraLogging
- The script outputs more information if this is set toTrue
. - Line 17:
timeRemaining
- Set this toTrue
to display time remaining instead of time elapsed while media is playing.
This project is licensed under the MIT License. See the LICENSE file for details.