π¬ Automatically show what you're watching on Trakt.tv in your Discord status!
This bot connects your Trakt.tv account to Discord, displaying your current TV shows and movies as a "Watching" activity in your Discord profile.
- π Proper "WATCHING" status - Shows as "Watching [Show]" not "Playing [Show]"
- πΌοΈ Show artwork - Displays movie/TV show posters as your activity image
- π Auto-sync - Updates every 15 seconds when you're watching something
- π Reconnects automatically - Handles Discord restarts and connection issues
- πΊ TV Shows & Movies - Works with both TV episodes and movies
- π₯οΈ Cross-platform - Works on Windows, macOS, and Linux
- Python 3.7+ - Download here
- Discord Desktop App - Must be running on your computer
- Trakt.tv account - Sign up free
-
Download this project:
git clone git@github.com:trakt/discord-presence.git cd discord-presenceCommand tip: Use whichever command launches Python 3 on your system. On macOS this is usually
python3/pip3; on Windows it may just bepython/pip. -
Install Python dependencies:
python3 -m pip install -r requirements.txt
-
Go to Trakt.tv API settings:
- Visit: https://trakt.tv/oauth/applications
- Click "New Application"
-
Fill out the application form:
- Name:
Discord Presence(or any name you like) - Description:
Shows my Trakt activity in Discord - Redirect URI:
urn:ietf:wg:oauth:2.0:oob - Permissions: None needed
- Name:
-
Save your credentials:
- After creating, you'll see:
- Client ID - Copy this code
- Client Secret - Copy this (keep it secret! keep it safe!)
- Click on your app name to see the Application ID (different from Client ID!). Easiest way is to read the ID from the end of the URL.
- After creating, you'll see:
Good news! This project includes a default Discord app called "TV with Trakt" that you can use immediately.
Option A: Use the default app (recommended for beginners)
- Skip this step! The default Discord Client ID is already in
.env.example - Your status will show as "Watching TV with Trakt"
Option B: Create your own custom Discord app
-
Go to Discord Developer Portal:
- Visit: https://discord.com/developers/applications
- Click "New Application"
-
Create your application:
- Name: Choose any name (this appears in your Discord status)
- Click "Create"
-
Get your Discord Client ID:
- On the "General Information" page
- Copy the Application ID (this is your Discord Client ID)
- Replace the default value in your
.envfile
-
Copy the example configuration:
cp .env.example .env
-
Edit the
.envfile with your Trakt credentials:TRAKT_CLIENT_ID=your_trakt_client_id_here TRAKT_CLIENT_SECRET=your_trakt_client_secret_here TRAKT_APPLICATION_ID=your_trakt_application_id_here DISCORD_CLIENT_ID=1387827471822622850 # Default app (or use your own)Note: The Discord Client ID has a working default value. Only change it if you created your own Discord app.
Option A: Quick Test (Recommended First)
python3 main.pyOption B: Install as Daemon (Linux - Runs Automatically)
# Install and enable automatic startup
python3 service.py install
# Management commands
python3 service.py start # Start the daemon
python3 service.py stop # Stop the daemon
python3 service.py status # Check if running
python3 service.py logs # View logs
python3 service.py uninstall # Remove daemonFirst-time setup (both options):
- The bot will open a browser for Trakt.tv authentication
- Log in to Trakt.tv and authorize the app
- Copy the PIN code back to the terminal
- Your credentials will be saved for future use
Check Discord:
- Make sure Discord is running
- Start watching something on Trakt.tv (check-in to a show/movie)
- Your Discord status should update automatically!
- Go to Trakt.tv or use the Trakt mobile app
- Find a TV show or movie you're watching
- Click the "Check In" button (
βΆοΈ icon) - Your Discord status will update within 15 seconds!
π¬ Watching TV with Trakt
Shark Tank
S16E2 - Episode 2
[Show poster image]
Started watching 5 minutes ago
The bot can run as a system daemon that automatically starts on boot and runs in the background.
# Test your configuration first
python3 service.py test
# Install and enable daemon
python3 service.py install
# Check if it's running
python3 service.py status- β Auto-start on login - No need to manually start
- β Background operation - Runs silently in background
- β Automatic restart - Restarts if it crashes
- β System integration - Uses systemd for proper service management
- β Log management - Logs to system journal
python3 service.py start # Start the daemon
python3 service.py stop # Stop the daemon
python3 service.py restart # Restart the daemon
python3 service.py enable # Enable auto-start on login
python3 service.py disable # Disable auto-start
python3 service.py status # Show current status
python3 service.py logs # View recent logs (Ctrl+C to exit)
python3 service.py uninstall # Remove daemon completelyLaunchd support lets the bot run automatically whenever you log in.
# Test your configuration first
python3 service.py test
# Install and load the LaunchAgent
python3 service.py install
# Check if it's running
python3 service.py statuspython3 service.py start # Load and start the LaunchAgent
python3 service.py stop # Unload (stop) the LaunchAgent
python3 service.py restart # Reload the LaunchAgent
python3 service.py enable # Enable auto-start on login
python3 service.py disable # Disable auto-start
python3 service.py status # Show LaunchAgent status
python3 service.py logs # Tail the launch agent logs
python3 service.py uninstall # Remove the LaunchAgentLaunchd writes stdout/stderr to logs/trakt-discord*.log. Use python3 service.py logs (Ctrl+C to exit) or tail -f logs/trakt-discord.log for live output.
- β Linux - systemd integration
- β macOS - launchd integration
β οΈ Windows - Manual setup (instructions provided)
Windows daemon automation is planned for a future release.
- β Make sure Discord Desktop app is running (not just web browser)
- β Restart Discord completely
- β Try running the bot as administrator (Windows)
- β
Double-check your Trakt credentials in
.env - β Make sure you copied the Application ID (not just Client ID)
- β
Verify redirect URI is exactly:
urn:ietf:wg:oauth:2.0:oob
- β Check-in to something on Trakt.tv first
- β Make sure you're actively checked in (not just marked as watched)
- β Try checking in to a different show/movie
- β Make sure your Discord app is named "TV with Trakt"
- β Restart Discord to clear cache
- β Wait a few minutes for Discord to update
"systemctl not found" or "systemd not available"
- β You're not on a systemd Linux distribution
- β
Run manually:
python3 main.py --daemon - β Use your distribution's service manager (upstart, OpenRC, etc.)
Daemon installed but not starting
- β
Check logs:
python3 service.py logs - β
Verify configuration:
python3 service.py test - β
Check if Discord is running:
ps aux | grep -i discord
Daemon running but Discord not updating
- β Make sure you're logged into the same user account where Discord runs
- β Check if you're checked into something on Trakt.tv
- β
View daemon logs:
journalctl --user -u trakt-discord-presence -f
Cross-Platform - Automatic Installation:
This project includes scripts to easily install the app as a daemon that starts automatically on login. The installer automatically detects your operating system:
# Install as daemon (runs automatically on login)
./scripts/install.sh
# Check daemon status and logs
./scripts/status.sh
# Uninstall daemon (keeps project files)
./scripts/uninstall.shPlatform Support:
- β macOS - Uses LaunchAgents for proper user-level daemon management
- β Windows - Uses Task Scheduler with PowerShell scripts
- π§ Linux - Coming soon (systemd user services)
What the daemon installer does:
- β Creates and activates Python virtual environment
- β Installs all dependencies automatically
- β Sets up auto-start on login (macOS: LaunchAgent, Windows: Task Scheduler)
- β Creates log files for monitoring
- β Handles automatic restarts if the app crashes
- β Runs in background without terminal/command prompt window
Manual Installation Examples:
Windows (Task Scheduler):
- Open Task Scheduler
- Create Basic Task β Daily β Start at computer startup
- Action: Start a program β Point to your Python installation and script
Linux (systemd):
# Create a systemd user service
systemctl --user enable trakt-discord-presence.serviceEdit main.py and change this line:
time.sleep(15) # Change 15 to your preferred secondsdiscord-presence/
βββ main.py # Main application
βββ discord_ipc.py # Custom Discord integration
βββ requirements.txt # Python dependencies
βββ .env.example # Configuration template
βββ .env # Your credentials (keep private!)
βββ scripts/ # Cross-platform daemon scripts
β βββ install.sh # Universal installer (detects OS)
β βββ status.sh # Universal status checker
β βββ uninstall.sh # Universal uninstaller
β βββ macos/ # macOS-specific files
β β βββ install.sh # macOS daemon installer
β β βββ uninstall.sh # macOS daemon uninstaller
β β βββ status.sh # macOS status checker
β β βββ README.md # macOS documentation
β βββ windows/ # Windows-specific files
β β βββ install.ps1 # Windows PowerShell installer
β β βββ uninstall.ps1 # Windows PowerShell uninstaller
β β βββ status.ps1 # Windows PowerShell status checker
β β βββ install.bat # Windows batch wrapper
β β βββ uninstall.bat # Windows batch wrapper
β β βββ status.bat # Windows batch wrapper
β β βββ README.md # Windows documentation
β βββ linux/ # Linux-specific files (coming soon)
β βββ README.md # Linux documentation
βββ logs/ # Daemon log files (created by installer)
β βββ trakt-discord.log # Application output
β βββ trakt-discord-error.log # Error messages
βββ README.md # This file
Found a bug or want to add a feature?
- Fork this repository
- Create a feature branch:
git checkout -b my-new-feature - Make your changes and test them
- Submit a pull request
Never share your .env file or commit it to version control! It contains your secret API keys.
The .env file is already in .gitignore to prevent accidental commits.
This project is open source. Feel free to use, modify, and distribute!
Having issues?
- Check the troubleshooting section above
- Search existing GitHub issues
- Create a new issue with:
- Your operating system
- Python version (
python3 --versionorpython --version) - Error messages (remove any API keys first!)
Enjoy showing off what you're watching! πΏ