Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 2.38 KB

README.md

File metadata and controls

50 lines (37 loc) · 2.38 KB

Discord Rich Presence for Plex

A Python script that displays your Plex status on Discord using Rich Presence.

Requirements

  • 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.

Configuration

Create a config.json file in the same directory as the python file.

Example

[
    {
        "server_name":"myserver1",
        "username":"myuser",
        "token":"mytoken"
    },
    {
        "server_name":"myserver2",
        "username":"myuser",
        "token":"mytoken"
    }
]

Parameters

  • server_name - Name of the Plex Media Server to connect to.
  • username - Your account's username or e-mail.
  • password (not required if token is set) - The password associated with the above account.
  • token (not required if password 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. Ignores password if set.
  • listen_for_user (optional) - The script will respond to alerts originating only from this username. Defaults to username if not set.
  • blacklisted_libraries (list, optional) - Alerts originating from blacklisted libraries are ignored.
  • whitelisted_libraries (list, optional) - If set, alerts originating from libraries that are not in the whitelist are ignored.

Other Variables

  • Line 16: extra_logging - The script outputs more information if this is set to True.
  • Line 17: time_remaining - Set this to True to display time remaining instead of time elapsed while media is playing.

License

This project is licensed under the MIT License. See the LICENSE file for details.