← all projects

plex-janitor

Delete watched episodes and films
repo maintenance plex plex-media-server

PLEX Janitor

This script lists and optionally deletes watched episodes and films in Plex.

It requires python 3.9+ and poetry.

Install:

Create config.ini with the following contents:

[Plex]
username = <username>
password = <password>
servername = <plex servername>

Run the script:

poetry install
poetry run python plexjanitor.py

The script makes the following assumptions:

This script will then go through each section and list deletable items. For TV Shows the most recent episode will be kept, as a marker for the last seen episode.

By default deletable items are listed but not deleted. By passing delete as a script parameter, items will be actually deleted!