Utilities and scripts for plex using the Plex API to clean up your Plex Music library.
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.
- Plex Login credentials (either
token
orusername/password
)
see Plex API Login documentation for more details. - Your Plex server URL
- Python 3.11
- Clone repository
git clone [email protected]:johnsturgeon/plex-tools.git
cd plex-tools
NOTE: Recommended: Use a virtual env
python -m venv venv
source venv/bin/activate
- Install requirements
pip install -r requirements.txt
- Run the script
python deduplex.py
- The script will walk you through the entire process
Join our discussion.
Detailed walk through for Deduplex
python deduplex.py
The script will walk you through an initial configuration, Optionally offer to save the config in a .env
file, and begin the search
If the .env file does not exist, you can opt to create it
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.
Safe mode will move duplicate tracks to a playlist for you to review and delete in Plex yourself.
If you choose not to enable safe mode, then your duplicates will be deleted directly
You will (optionally) be shown some brief instructions for how to choose your duplicates, it will be more obvious once you begin.
Each song that has duplicate(s) files will present you with a choice for choosing which songs to delete
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.