Skip to content

johnsturgeon/plex-tools

Repository files navigation

GoshDarned Tools

Utilities and scripts for plex using the Plex API to clean up your Plex Music library.


Deduplex: deduplex.py

This script will search your Plex Music Library for duplicates. It will provide information for you to decide which ones you want to clean. You can choose to "Safe Clean" (place all duplicates in a playlist) or delete.

Prerequisites

  • Plex Login credentials (either token or username/password)
    see Plex API Login documentation for more details.
  • Your Plex server URL
  • Python 3.11

Quick Start

  • Install dependencies
git clone [email protected]:johnsturgeon/plex-tools.git
cd plex-tools

NOTE: Recommended: Use a virtual env

pip install -r requirements.txt
  • Run the script python deduplex.py
  • The script will walk you through the entire process

Questions / Comments / Requests?

Join our discussion.

Detailed walk-through

Detailed walk through for Deduplex

Usage

python deduplexs.py

The script will walk you through an initial configuration, Optionally offer to save the config in a .env file, and begin the search

.env

If the .env file does not exist, you can opt to create it

image

Setup

The setup process will attempt to connect to your plex server using credentials supplied in the .env file. If successful, it will search for duplicates.

image

Safe Mode

Safe mode will move duplicate tracks to a playlist for you to review and delete in Plex yourself.

image

If you choose not to enable safe mode, then your duplicates will be deleted directly

Instructions

You will (optionally) be shown some brief instructions for how to choose your duplicates, it will be more obvious once you begin.

image

Duplicate chooser

Each song that has duplicate(s) files will present you with a choice for choosing which songs to delete

image

Final review

You will be asked if you'd like to review the actual files that you've chosen for clean-up then, either the files will be placed into a playlist (safe delete) or deleted.