A lightweight Discord Rich Presence client that displays real-time streaming activity. Shows titles, episode numbers, timestamps, and dynamic poster images in your Discord profile.
- Real-time playback tracking with configurable update intervals
- Dynamic poster images pulled directly from streaming sites
- Episode and timestamp tracking with automatic detection
- Clickable links in presence for direct episode access
- Automatic content detection with no manual input required
- HiAnime (hianime.to / hianime.do)
- YouTube
- Netflix
- Crunchyroll
- Additional streaming platforms
- Python 3.8 or higher
- Discord Desktop Application
- Chromium-based browser (Chrome, Edge, Brave, Opera)
- Discord Developer Application credentials
Follow these steps to get up and running in minutes.
- Navigate to Discord Developer Portal
- Click "New Application" and provide a name (e.g., "Watching")
- Copy the Application ID from the General Information page
# Clone the repository
git clone https://github.com/BraxtonElmer/StreamPresence.git
cd StreamPresenceCreate a .env file in the project root:
DISCORD_CLIENT_ID=your_application_id_here
FLASK_PORT=8731
FLASK_HOST=127.0.0.1
LARGE_IMAGE_KEY=Windows:
start.batmacOS/Linux:
chmod +x start.sh
./start.shThe script will automatically:
- Create a virtual environment
- Install all dependencies
- Start the Flask server
- Open
chrome://extensions/in your browser - Enable "Developer mode" (toggle in top-right)
- Click "Load unpacked"
- Select the
pluginfolder from the project directory
- Ensure Discord Desktop is running
- Navigate to a supported streaming site (e.g., HiAnime)
- Start playing content
- Check your Discord profile for the updated presence
For users who prefer manual setup or need more control over the installation process.
- Navigate to Discord Developer Portal
- Click "New Application" and provide a name
- Copy the Application ID from the General Information page
- Optional: Upload custom images under Rich Presence > Art Assets
git clone https://github.com/BraxtonElmer/StreamPresence.git
cd StreamPresenceCreate a virtual environment:
# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtCreate a .env file in the project root with the following content:
DISCORD_CLIENT_ID=your_application_id_here
FLASK_PORT=8731
FLASK_HOST=127.0.0.1
LARGE_IMAGE_KEY=- Navigate to
chrome://extensions/in your browser - Enable "Developer mode" using the toggle in the top-right
- Click "Load unpacked"
- Select the
pluginfolder from the project directory - Verify the extension appears in your extensions list
cd python
python app.pyExpected output:
Discord Rich Presence Server running on 127.0.0.1:8731
Watching for activity from browser extension...
- Ensure Discord Desktop is running
- Navigate to a supported streaming site
- Begin playback of any content
- Check your Discord profile for updated presence information
The system operates in three stages:
- Browser Extension: Detects and extracts content metadata (title, episode, timestamp) from web pages
- Flask Server: Receives HTTP POST requests containing metadata from the browser extension
- Discord RPC: Updates your Discord Rich Presence using the pypresence library via IPC
Browser Extension --> Flask Server --> Discord RPC
(HTTP POST) (Python) (IPC)
StreamPresence/
├── plugin/ # Browser extension
│ ├── manifest.json # Extension metadata
│ ├── content.js # Content detection script
│ └── background.js # Background service worker
├── python/ # Backend server
│ └── app.py # Flask application
├── .env # Environment configuration (required)
├── config.json # Application settings (optional)
├── .gitignore # Git exclusions
├── LICENSE # MIT License
├── README.md # Documentation
├── requirements.txt # Python dependencies
├── start.bat # Windows launcher
└── start.sh # Unix launcher
Required:
DISCORD_CLIENT_ID=your_application_id_hereOptional:
FLASK_PORT=8731 # Server port (default: 8731)
FLASK_HOST=127.0.0.1 # Server host (default: 127.0.0.1)
LARGE_IMAGE_KEY= # Static Discord asset key (leave empty for dynamic images)The included config.json file allows you to customize application behavior:
{
"update_interval": 5
}Available Settings:
update_interval(number): Seconds between Discord Rich Presence updates- Default: 5 seconds
- Recommended: 5-15 seconds to avoid Discord's rate limit (5 updates per 20 seconds)
- Note: The browser extension sends data every 1 second; the server rate-limits outgoing updates based on this setting
Edit config.json and restart the server to apply changes.
- Verify Discord Desktop application is running (web version not supported)
- Confirm Flask server is running without errors
- Check that the Client ID in
.envmatches your Discord Application - Restart Discord completely
- Reload the extension at
chrome://extensions/ - Refresh the streaming site page
- Check browser console (F12) for error messages
- Verify extension permissions are granted
When you see "Extension context invalidated":
- This occurs when reloading the extension while pages are open
- Refresh all streaming site tabs to resolve
- Verify
.envfile exists and contains valid credentials - Check that port 8731 is not in use by another application
- Ensure firewall is not blocking local connections
Contributions are welcome. See CONTRIBUTING.md for guidelines on:
- Adding support for new streaming platforms
- Improving content detection algorithms
- Bug fixes and performance improvements
- Documentation enhancements
- Modify
content.jsin thepluginfolder or create a new content script - Implement detection for: title, episode, timestamp, duration, poster URL
- Test thoroughly across different content types
- Update documentation with platform-specific notes
# Install development dependencies
pip install -r requirements.txt
# Start server with debug mode
cd python
python app.py- Make changes to extension files in the
pluginfolder - Reload extension at
chrome://extensions/ - Refresh test pages
- Verify functionality
- Never commit your
.envfile to version control - The
.gitignorefile excludes.envby default - Keep your Discord Application credentials private
- Review extension permissions before installation
This project is licensed under the MIT License. See LICENSE for details.
This project is intended for educational purposes. Respect the terms of service of all streaming platforms you use.
- Backend: Flask (Python web framework)
- RPC Library: pypresence (Discord Rich Presence implementation)
- Extension: Manifest V3 Chrome Extension
- Configuration: python-dotenv for environment management
See CHANGELOG.md for version history and release notes.
For bug reports and feature requests, open an issue on GitHub with:
- Browser name and version
- Python version
- Streaming platform URL
- Error messages or console output
- Steps to reproduce the issue