A CLI and web GUI tool for creating Plex collections from RED and OPS collages and bookmarks
Project description
red-plex
A command-line tool and web interface for creating and updating Plex collections based on collages and bookmarks from Gazelle-based music trackers like Redacted ("RED") and Orpheus Network ("OPS").
red-plex bridges the gap between your curated music collections on private trackers and your personal Plex media server, automatically creating and maintaining Plex collections that mirror your tracker collages and bookmarks.
Quick Start
- Install red-plex:
pip install red-plex - Configure your API keys:
red-plex config edit - Create your first collection:
- CLI:
red-plex collages convert 12345 --site red - Web GUI:
red-plex gui(then visit http://127.0.0.1:8000)
- CLI:
Web Interface
red-plex now includes a comprehensive web-based GUI for users who prefer a visual interface over command-line operations.
Features
- 🌐 Dashboard: Clean overview with feature cards and navigation
- ⚙️ Configuration Management: View and edit all settings (API keys, Plex config, rate limits) through web forms
- 🎨 Collage Operations: Convert new collages and view existing collections
- 🔖 Bookmark Operations: Convert bookmarks from RED and OPS trackers
- 🗄️ Database Management: View statistics, update albums, reset tables
- ⚡ Real-time Updates: Live status updates during long operations via WebSocket
- 📱 Mobile-Responsive: Bootstrap-based design that works on all devices
Usage
# Launch GUI server (default: http://127.0.0.1:8000)
red-plex gui
# Custom host/port
red-plex gui --host 0.0.0.0 --port 8080
# Debug mode with auto-reload
red-plex gui --debug
The web interface provides the same functionality as the CLI commands but with a user-friendly visual interface, real-time progress updates, and intuitive navigation.
What are RED and OPS?
- Redacted (RED): A private music tracker focused on high-quality audio files
- Orpheus Network (OPS): Another private music tracker with curated content
- Both use the Gazelle framework and offer "collages" (curated collections) and personal bookmarks
Table of Contents
- Prerequisites
- Installation
- Getting API Keys
- Configuration
- Web Interface
- Overview
- Features
- Usage & Commands
- Examples
- Configuration Details
- Configuration Tips
- Troubleshooting
- Important Considerations
- Contributing
Prerequisites
- Python 3.8 or higher
- Plex Media Server with a configured music library
- Active account on RED and/or OPS with API access
- Music library organized in your Plex server
Installation
Using pip (recommended)
pip install red-plex
Using pipx (isolated environment)
pipx install red-plex
From source
git clone https://github.com/marceljungle/red-plex.git
cd red-plex
pip install -e .
Getting API Keys
For Redacted (RED)
- Log into your RED account
- Go to your profile settings
- Navigate to "Access Settings" or "API"
- Generate a new API key
- Keep this key secure and private
For Orpheus Network (OPS)
- Log into your OPS account
- Go to your user settings
- Find the API section
- Generate a new API key
- Keep this key secure and private
Configuration
After installation, you need to configure red-plex with your credentials:
# Open configuration file in your default editor
red-plex config edit
Edit the configuration file with your details:
LOG_LEVEL: INFO
PLEX_URL: http://localhost:32400
PLEX_TOKEN: your_plex_token_here
SECTION_NAME: Music
RED:
API_KEY: your_red_api_key_here
BASE_URL: https://redacted.sh
RATE_LIMIT:
calls: 10
seconds: 10
OPS:
API_KEY: your_ops_api_key_here
BASE_URL: https://orpheus.network
RATE_LIMIT:
calls: 4
seconds: 15
Getting Your Plex Token
Visit: https://plex.tv/api/resources?includeHttps=1&X-Plex-Token={YOUR_TOKEN}
Overview
- Stores Data in SQLite: Instead of CSV-based "caches," red-plex now stores albums, collages, and bookmarks in a lightweight SQLite database.
- Collages & Bookmarks: Fetch and manage torrent-based "collages" or personal "bookmarks" from Gazelle-based sites.
- Plex Integration: Compare the torrent group info with your Plex music library to create or update Plex collections.
- Flexible Album Matching: Match albums in Plex using either the original
torrent_name(directory name) or a query-based approach (Artist/Album), ideal for organized libraries (e.g., Beets/Lidarr). - Incremental Updating: Update previously created collections as new albums become available or site data changes.
Features
- Multi-Site: Works with Redacted ("red") and Orpheus Network ("ops").
- Web Interface: Modern Flask-based GUI with Bootstrap styling and real-time updates.
- Collections from Collages/Bookmarks: Create or update entire Plex collections for each collage or bookmarked set.
- Local SQLite Database: All data (albums, collages, bookmarks) is kept in one DB, no more CSV.
- Two Fetch Modes: Choose between
torrent_name(default) for direct path matching orqueryfor metadata-based searches in Plex. - Configurable Logging: Choose between INFO, DEBUG, etc., in
config.yml. - Rate Limiting: Respects site rate limits and retries on errors.
- Dual Interface: Access all functionality via both command-line interface and web GUI.
- Python 3.8+ Compatible: Runs on modern Python versions with no external database dependencies.
Usage & Commands
Type red-plex --help for detailed usage. Below is a summary of the main commands.
Web Interface Commands
# Launch web GUI server
red-plex gui [--host HOST] [--port PORT] [--debug]
# Examples:
red-plex gui # Default: http://127.0.0.1:8000
red-plex gui --host 0.0.0.0 # Bind to all interfaces
red-plex gui --port 8080 # Custom port
red-plex gui --debug # Debug mode with auto-reload
Configuration Commands
# Show current configuration (YAML)
red-plex config show
# Edit configuration in your default editor
red-plex config edit
# Reset configuration to default values
red-plex config reset
Collages
# Create Plex collections for specific collage IDs
red-plex collages convert [COLLAGE_IDS] --site [red|ops] --fetch-mode [torrent_name|query]
# Update all collages in the database, re-checking the site data
red-plex collages update --fetch-mode [torrent_name|query]
Bookmarks
# Create Plex collections from your bookmarked releases
red-plex bookmarks convert --site [red|ops] --fetch-mode [torrent_name|query]
# Update all bookmarks in the database
red-plex bookmarks update --fetch-mode [torrent_name|query]
Fetch Mode (-fm)
The --fetch-mode (or -fm) option controls how red-plex locates albums in Plex:
For all commands (collages convert, collages update, bookmarks convert, bookmarks update):
- torrent_name (default): Searches for directories matching the torrent folder name
- query: Searches using
ArtistandAlbummetadata, ideal for organized libraries managed by tools like Beets or Lidarr
Database Commands
# Show database location
red-plex db location
# Manage albums table
red-plex db albums reset # Clear all album records
red-plex db albums update # Pull fresh album info from Plex
# Manage collections table
red-plex db collections reset # Clear the collage collections table
# Manage bookmarks table
red-plex db bookmarks reset # Clear the bookmark collections table
Examples
Creating Collections
# Single collage (Redacted), default mode
red-plex collages convert 12345 --site red
# Multiple collages (Orpheus), default mode
red-plex collages convert 1111 2222 3333 --site ops
# From bookmarks (RED or OPS), default mode
red-plex bookmarks convert --site red
Updating Collections
# Update all stored collages
red-plex collages update
# Update all stored bookmarks
red-plex bookmarks update
# Update albums from Plex
red-plex db albums update
Using Query Fetch Mode
# Create a collection using query mode (for Beets/Lidarr organized libraries)
red-plex collages convert 12345 --site red --fetch-mode query
# Update all bookmarks using query mode
red-plex bookmarks update --site ops -fm query
Complete Workflow Example
Command Line Interface
# 1. First time setup
red-plex config edit # Add your API keys and Plex details
# 2. Update your local album database from Plex
red-plex db albums update
# 3. Create collections from specific collages
red-plex collages convert 12345 67890 --site red
# 4. Create collection from your bookmarks
red-plex bookmarks convert --site red
# 5. Later, update all collections with new releases
red-plex collages update
red-plex bookmarks update
Web Interface
# 1. Launch the web interface
red-plex gui
# 2. Open http://127.0.0.1:8000 in your browser
# 3. Navigate to Configuration to add your API keys and Plex details
# 4. Use the Database page to update your local album database
# 5. Use the Collages page to convert specific collages
# 6. Use the Bookmarks page to convert your bookmarks
# 7. Return to Database page later to update all collections
Configuration Details
By default, configuration is stored in ~/.config/red-plex/config.yml:
LOG_LEVEL: INFO
OPS:
API_KEY: your_ops_api_key_here
BASE_URL: https://orpheus.network
RATE_LIMIT:
calls: 4
seconds: 15
PLEX_TOKEN: your_plex_token_here
PLEX_URL: http://localhost:32400
RED:
API_KEY: your_red_api_key_here
BASE_URL: https://redacted.sh
RATE_LIMIT:
calls: 10
seconds: 10
SECTION_NAME: Music
Configuration Tips
- If HTTP fails, fetch an HTTPS URL:
https://plex.tv/api/resources?includeHttps=1&X-Plex-Token={YOUR_TOKEN} - Look for the
<Device>node in the XML for auri, use thisplex.directaddress. - Use
DEBUGlog level for verbose debugging information - Use
WARNINGlog level for minimal output
Troubleshooting
Common Issues
"No module named 'plexapi'" Error
pip install plexapi
# or
pip install red-plex --upgrade
Authentication Errors
- Verify your API keys are correct in
config.yml - Check that your Plex token is valid
- Ensure you have access to the sites you're trying to use
No Albums Found
- Run
red-plex db albums updateto refresh your Plex library - Check that your Plex music library is properly configured
- Verify the
SECTION_NAMEin your config matches your Plex music library name
Rate Limiting Issues
- The tool respects site rate limits automatically
- If you encounter issues, try reducing the rate limit values in your config
Fetch Mode Issues
- Use
torrent_namemode if your library structure matches torrent folder names - Use
querymode if you use Beets, Lidarr, or have renamed your music files - Try both modes to see which works better for your library
Web Interface Issues
- GUI won't start: Ensure
gunicornandeventletare installed:pip install gunicorn eventlet - Can't access GUI: Check if the port is available and not blocked by firewall
- GUI stuck on "Starting...": Check terminal logs for error messages
- WebSocket connection failed: Ensure your browser supports WebSockets and isn't blocking them
Getting Help
- Check the logs with
LOG_LEVEL: DEBUGin your config - Verify your configuration with
red-plex config show - Test your Plex connection by running
red-plex db albums update - Open an issue on GitHub with detailed error messages
Important Considerations
- Album Matching Strategy:
torrent_name(default): Matches albums by comparing torrent folder names with Plex directory pathsquery: Uses artist and album metadata for matching, ideal for libraries organized by Beets, Lidarr, or other tools that rename files
- Database Management: All data is stored in
red_plex.db. Use database reset commands (db albums reset, etc.) to clear specific tables when needed - Site Credentials: Ensure your API keys are valid and have proper permissions
- Rate Limiting: The tool automatically respects site-specific rate limits to avoid being banned
- Logging Levels:
DEBUG: Verbose output for troubleshootingINFO: Standard information (default)WARNING: Minimal output
- Collection Updates: When you run
collages updateorbookmarks update, new albums are added to existing Plex collections, but removed items from tracker collages are not automatically removed from Plex collections
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
git clone https://github.com/marceljungle/red-plex.git
cd red-plex
pip install -e .
Disclaimer: This tool is for personal use with your own music library and tracker accounts. Respect the rules and terms of service of the private trackers you use.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file red_plex-1.11.0.tar.gz.
File metadata
- Download URL: red_plex-1.11.0.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d719bf2328981c5a9110dd7f40b880d0c18c540313da84110e4a039348e96c1
|
|
| MD5 |
cd342e110e2b18a44b580fe149d35e25
|
|
| BLAKE2b-256 |
20455efa9d456317f1f485b31754f9a3d8029a88f2dfe0460ebd3bb835d9ac01
|
File details
Details for the file red_plex-1.11.0-py3-none-any.whl.
File metadata
- Download URL: red_plex-1.11.0-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a87d92c4bf92cf3b5cc5b5cf351b27e453c2d8be23237a1c9796da26ae33d89b
|
|
| MD5 |
cba708a04c54b4cec31b6be184997fa6
|
|
| BLAKE2b-256 |
2580dd4fa745c4b110fc1d49590e79718d27ac88e533a5daaff17d63834cb451
|