Skip to content

Automatically delete old movies. Additionally you can set a whitelist file or generate this whitelist file from plex playlists.

Notifications You must be signed in to change notification settings

plankes-projects/OldMovieRemover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

OldMovieRemover

This setup works on all operating systems and will automatically delete old movies. Additionally you can set a whitelist file or generate this whitelist file from plex playlists.

Run the scripts every day automatically with the system of your choosing. eg.: cron (linux) or task scheduler (windows).

Automatically delete old movies

java -jar MovieCleanup.jar <whitelist_file> <clean_directory> <max_dirs> <del|safe>

eg.:

java -jar MovieCleanup.jar /volume/whitelistfile /volume/movies/ 100 safe

This script will automatically delete files/directories if you have more than the defined number in your clean_directory path. It preferes files/directories which has the oldest 'created date'. 'Modified date' will be taken if your file system does not support 'created date'.

The safe flag in the end performs a safe run. This means it will not delete any data but instead only prints out what it would delete. Use the del flag for deletion.

eg.:

java -jar MovieCleanup.jar /volume/whitelistfile /volume/movies/ 100 del

Create whitelist file manually

One movie per line. One line should look like this: /volume/movies/My Movie (2018)/my.movie.mkv

The parent directory, in this case 'My Movie (2018)', will be compared.

Generate whitelist file from plex playlists

pip install plexapi

python plex_playlist_extractor.py <plex_token> <plex_server> <target_file>

eg:

python plex_playlist_extractor.py "asdeuz23SDacvsgh" "https://myplexserver.com:32400" /volume/whitelistfile

I recomment to run the whitelist_file generation shortly before the delete script.

FAQ

Why dont you perform this in one script?

I still want to cleanup my movies if plex connection fails.

About

Automatically delete old movies. Additionally you can set a whitelist file or generate this whitelist file from plex playlists.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published