Skip to main content

A tool for creating Plex playlists from RED collages

Project description

red-plex

red-plex is a command-line tool for creating Plex playlists based on collages from RED. It allows users to generate playlists in their Plex Media Server by matching music albums from specified collages.

Table of Contents

  1. Features
  2. Requirements
  3. Installation
  4. Configuration
  5. Usage
  6. Considerations

Features

  • Create Plex playlists from RED collages.
  • Support for multiple collage IDs.
  • Easy configuration using a config.yml file.
  • Command-line interface (CLI) for seamless interaction.
  • Handles rate limiting and retries for API calls.
  • Compatible with Python 3.7 and above.

Requirements

  • Python 3.7 or higher
  • Plex Media Server with accessible API
  • RED API key

Python modules

  • plexapi
  • requests
  • click
  • pyrate-limiter
  • tenacity
  • pyyaml

Installation

You can install red-plex using pip:

pip install red-plex

Alternatively, you can install it using pipx to isolate the package and its dependencies:

pipx install red-plex

Configuration

Before using red-plex, you need to configure it with your Plex and REDacted API credentials.

Steps to configure

  1. Edit the Configuration File

    Run the following command to open the configuration file in your default editor:

    red-plex config edit
    

    If it’s the first time you’re running this command, it will create a default configuration file at ~/.config/red-plex/config.yml.

  2. Update Configuration Settings In the config.yml file, update the following settings:

    PLEX_URL: 'http://localhost:32400'   # URL of your Plex Media Server
    PLEX_TOKEN: 'your_plex_token_here'   # Your Plex API token
    SECTION_NAME: 'Music'                # The name of your music library section in Plex
    RED_API_KEY: 'your_red_api_key_here' # Your REDacted API key 
    
    • PLEX_URL: The URL where your Plex server is accessible. Defaults to http://localhost:32400.
    • PLEX_TOKEN: Your Plex API token. You can obtain this from the Plex web app under account settings.
    • SECTION_NAME: The name of your music library in Plex. Defaults to Music.
    • RED_API_KEY: Your API key from the REDacted tracker.
  3. Save and Close the Configuration File After updating the configuration, save the file and close the editor.

    Viewing Configuration

    You can view your current configuration settings by running:

    red-plex config show
    
    Resetting Configuration

    To reset your configuration to the default values:

    red-plex config reset
    

Usage

Commands

red-plex provides the following commands:

  • red-plex convert [COLLAGE_IDS]: Creates Plex playlists from the specified RED collage IDs.
  • red-plex config show: Displays the current configuration settings.
  • red-plex config edit: Opens the configuration file in your default editor.
  • red-plex config reset: Resets the configuration to default values.

Examples

Creating Playlists from Collages

To create playlists from one or more collage IDs:

red-plex convert 12345 67890

This command will:

  • Fetch the collages with IDs 12345 and 67890 from RED.
  • Match the albums in the collages with your Plex music library.
  • Create playlists in Plex named after the collages.

Viewing Configuration

red-plex config show

Editing Configuration

red-plex config edit

Resetting Configuration

red-plex config reset

Considerations

  • Bad tagged albums won't be counted in some cases.
  • It has to be run on the host which has Plex Server running. (For now)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

red_plex-1.1.1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

red_plex-1.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file red_plex-1.1.1.tar.gz.

File metadata

  • Download URL: red_plex-1.1.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for red_plex-1.1.1.tar.gz
Algorithm Hash digest
SHA256 6fc2b9eeb4f355d45d40cd0ee3ba3b648c6053fd7fd77b2e6638703a4ea67cdf
MD5 2b73547bb3b70acec84ff2c548c99e76
BLAKE2b-256 6ff246c24d4faee5d602f20d7d0f5d27709c949c6b787f09ef4dc6cd40afa904

See more details on using hashes here.

File details

Details for the file red_plex-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: red_plex-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for red_plex-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d25da3e0152b54832a5d6a6c4c197baaef9fb55164aef8795164eb64c015418
MD5 03284132efbd834da7d5505cf4a97f23
BLAKE2b-256 a24e19a69f365c3d435383c5774da1e78c63d1ca419434f1cf847b196a86275e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page