2018-02-15 00:20:41 +05:30
# Discord Rich Presence for Plex
2022-05-11 01:53:12 +05:30
A Python script that displays your [Plex ](https://www.plex.tv ) status on [Discord ](https://discord.com ) using [Rich Presence ](https://discord.com/developers/docs/rich-presence/how-to ).
2018-02-15 00:20:41 +05:30
2022-05-11 01:53:12 +05:30
## Getting Started
2018-02-15 00:20:41 +05:30
2022-05-11 01:53:12 +05:30
1. Install [Python 3.10 ](https://www.python.org/downloads/ )
2. [Download ](archive/refs/heads/master.zip ) the ZIP file containing the files in this repository
3. Extract the contents of the above ZIP file into a new directory
4. Navigate a command-line interface (cmd.exe, PowerShell, bash, etc.) to the above directory
5. Install the required Python modules by running `python -m pip install -r requirements.txt`
6. Start the script by running `python main.py`
2018-02-15 00:20:41 +05:30
2022-05-11 01:53:12 +05:30
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 your username and an access token.
2018-02-15 00:20:41 +05:30
2022-05-11 01:53:12 +05:30
The script must be running on the same machine as your Discord client.
2018-04-25 00:42:55 +05:30
2022-05-11 01:53:12 +05:30
## Configuration - `config.json`
2018-04-25 00:42:55 +05:30
2022-05-11 01:53:12 +05:30
### Reference
2018-04-25 00:42:55 +05:30
2022-05-11 01:53:12 +05:30
* `logging`
* `debug` - Output more information to the console
* `display`
* `useRemainingTime` - Display remaining time in your Rich Presence instead of elapsed time
* `users` (list)
* `username` - Username or e-mail
* `token` - A [X-Plex-Token ](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token )
* `servers` (list)
* `name` - Friendly name of the Plex Media Server you wish to connect to.
* `blacklistedLibraries` (optional list) - Alerts originating from libraries in this list are ignored.
* `whitelistedLibraries` (optional list) - If set, alerts originating from libraries that are not in this list are ignored.
2018-04-25 00:42:55 +05:30
2022-05-11 01:53:12 +05:30
### Example
2018-04-25 00:42:55 +05:30
2022-05-11 01:53:12 +05:30
```json
{
"logging": {
"debug": true
},
"display": {
"useRemainingTime": false
},
"users": [
{
"username": "bob",
"token": "HPbrz2NhfLRjU888Rrdt",
"servers": [
{
"name": "Bob's Home Media Server",
},
{
"name": "A Friend's Server",
"whitelistedLibraries": ["Movies"]
}
]
}
]
}
```
2018-02-15 01:51:51 +05:30
## License
2022-05-11 01:53:12 +05:30
This project is licensed under the MIT License. See the [LICENSE ](LICENSE ) file for details.
## Credits
* [Discord ](https://discord.com )
* [Plex ](https://www.plex.tv )
* [plexapi ](https://github.com/pkkid/python-plexapi )
* [websocket-client ](https://github.com/websocket-client/websocket-client )