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.2.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

red_plex-1.2.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: red_plex-1.2.0.tar.gz
  • Upload date:
  • Size: 12.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 47c324f617ccae375aebf5a53f70d5c956b56e43e7eb32297d6e9efa1f0843b7
MD5 7a3445dac83703424803b84b3c952591
BLAKE2b-256 540327730edeb75c241b648cef2c5fc827c4175283626c2ffbaca390951e6810

See more details on using hashes here.

File details

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

File metadata

  • Download URL: red_plex-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e192ae3ec869b4a29d196fd7da6c34aa22a150219db08168438399b1c6ff632f
MD5 5d63b2f7279aa6673a9563bb1bb8c79e
BLAKE2b-256 bb9b62c074b7322d58552b9e4c7ff755535bbcac5cf8835328b0086fe8945547

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