This project integrates Jellyfin with Discord Rich Presence, allowing you to display your currently playing media on Jellyfin as your Discord status. The script fetches the currently playing media from Jellyfin, and updates your Discord status with details about the media, including the track name, artists, album, and progress.
- Displays the currently playing media from Jellyfin on Discord
- Supports multiple media types:
- Music: Shows track name, artists, album, and progress
- Movies: Displays title, year, and genres
- TV Shows: Shows series name, season, episode number, and episode title
- Fetches album covers from OMDB API when available
- Shows playback status (paused/muted)
- Displays client information (which device is playing the media)
- Includes external links as Discord buttons (e.g., IMDb links)
- Automatically reconnects to Discord RPC if the connection is lost
- Comprehensive logging for debugging and monitoring
- A running instance of Jellyfin with a valid API key
- A Discord application with the Client ID to connect to Discord RPC
- Python 3.x installed
- OMDB API key (optional, for movie posters)
-
Clone the Repository:
git clone https://github.com/Ray-kong/jellyfin-discord-rich-presence.git cd jellyfin-discord-rich-presence -
Install the Required Python Packages:
Use the
requirements.txtfile to install all the necessary dependencies:pip install -r requirements.txt
-
Create a
.envFile:Create a
.envfile in the project root directory with the following environment variables:JELLYFIN_URL=<Your Jellyfin server URL> JELLYFIN_API_KEY=<Your Jellyfin API key> JELLYFIN_USER_ID=<Your Jellyfin user ID> DISCORD_CLIENT_ID=<Your Discord application client ID> OMDB_API_KEY=<Your OMDB API key> # Optional, for movie posters
-
Jellyfin API Key:
- Log in to your Jellyfin server
- Go to
Dashboard->API Keys - Click
Create API Key - Copy the generated API key and use it in the
.envfile
-
Jellyfin User ID:
- Go to
Dashboard->Users - Click on the user you want to use
- The user ID is in the URL after
/users/
- Go to
-
Discord Client ID:
- Go to the Discord Developer Portal
- Create a new application
- Copy the Client ID from the application's General Information page
-
OMDB API Key:
- Go to OMDB API
- Request a free API key
- Add it to your
.envfile (optional)
-
-
Set Up Your Discord Application:
- Ensure your Discord application has the necessary permissions to use Rich Presence
- Enable the "Rich Presence" feature in your Discord application settings
-
Run the Script:
python main.py
-
Ensure Continuous Operation:
- The script needs to run 24/7 to continuously update your Discord status with your Jellyfin activity
- It can be run on any machine where Python is installed, but you might want to use a server or a device that's always on
-
The status is updated every 5 seconds. If no media is playing, the Discord status will be cleared.
- Logs are stored in the
jellyfin_rpc.logfile in the project root directory - Logs include:
- Connection status
- Currently playing media details
- Playback status (paused/muted)
- Client information
- Any errors encountered
Feel free to fork the repository and submit pull requests for any improvements or bug fixes. Make sure to update the documentation if you add any new features.
This project is licensed under the MIT License. See the LICENSE file for more details.