Plex Auto-Delete Script

I’ve been using this script on Windows for years and love it. Just changed over to a synology NAS server and really don’t know the first thing other than I’m supposed to run this in Docker. I downloaded docker on the NAS but really not sure where to go from there. Can someone just guide me in the right direction?

Would very much appreciate it!

I’ve installed the docker plex cleaner via the images section of docker but can’t figure anything out from there. How do I execute this from the github instructions? Thanks!

docker pull nitrikx/plex-cleaner
docker run -ti -v /path/to/config/folder:/config nitrikx/plex-cleaner

So I’ve decided to just run the script locally on my windows machine and connect to the plex server on my synology. Found my token, can connect fine to the server, and can find all the media files just fine, but for files that are marked to be moved/deleted, I’m getting a NOT FOUND (though the files are indeed in the location listed in the log file).

For files that should be kept, the log just lists as KEEPING without issue. Any ideas? Thanks.

The Man in the High Castle - S02xE002 - The Road Less Traveled | Viewed: 1 | Days Since Last Viewed: 3 | On Deck: False
[NOT FOUND] /volume1/Media/TV/Processed/The Man in the High Castle/2/The Man in the High Castle - S02E02 - The Road Less Traveled.mkv

Hi @ngovil21, very nice script, I just installed it on my Qnap. One question so far, what does default_progressAsWatched do and what are the settings?

Can you give instructions on how to install this on Qnap?

You will need to read throught the posts above, this is a python script and will run on Qnap

Please help, I tried changing the default action to move, delete, but after running with --test, only the flag will be displayed and never deleted?

            Summary -- Script Completed

** Currently in testing mode. Please review the changes below. **
Remove test from the configuration if everything looks okay.

Config file: /home/pi/Cleaner.conf
Total File Count 451
Kept Show Files 437
On Deck Files 13
Deleted Files 0
Moved Files 0
Copied Files 0
Flagged Files 14
Rescanned Sections

in /home/pi/Cleaner.conf:

{
“test”: true,
“Host”: “127.0.0.1”,
“Port”: “32400”,
“SectionList”: [
7,
3
],
“LogFile”: “/mnt/usbdrive/Backup/Log/plexclean.log”,
“LogFileMode”: “overwrite”,
“trigger_rescan”: false,
“Token”: “xxxxxx”,
“Shared”: true,
“DeviceName”: “xxxx”,
“plex_delete”: false,
“similar_files”: true,
“cleanup_movie_folders”: false,
“minimum_folder_size”: 30,
“default_episodes”: 1,
“default_minDays”: 1,
“default_maxDays”: 2,
“default_action”: “move”,
“default_watched”: true,
“default_progressAsWatched”: 50,
“default_location”: “/mnt/usbdrive/Movies/Test/”,
“default_onDeck”: true,
“default_homeUsers”: “xxxxx”,
“default_ignoreFolders”: [
“/mnt/usbdrive/4K video/”,
“/mnt/usbdrive/Music/”
],
“ShowPreferences”: {
“Show 1”: {
“onDeck”: true,
“maxDays”: 2,
“minDays”: 1,
“episodes”: 3,
“location”: “/mnt/usbdrive/”,
“action”: “move”,
“watched”: true
},
“Show 2”: {
“onDeck”: false,
“maxDays”: 2,
“minDays”: 1,
“episodes”: 0,
“location”: “/path/to/folder”,
“action”: “move”,
“watched”: true
},
“Show 3”: {
“action”: “keep”
}
},
“MoviePreferences”: {
“action”: “move”,
“location”: “”,
“minDays”: 1,
“onDeck”: true,
“watched”: true
},
“Profiles”: {
“Profile 1”: {
“onDeck”: true,
“maxDays”: 2,
“minDays”: 1,
“homeUsers”: “”,
“episodes”: 3,
“location”: “/path/to/folder”,
“action”: “move”,
“watched”: true
}
},
“Version”: 2.0,
“Client_ID”: “xxxxxxxx”
}

correct the --test flag will just identify the files which will be moved when you run the script without the test flag. since you have the default action set to move
I suggest running the script without the test flag and see if it moves those files into the default location folder. if it does then you’re good to go if it doesn’t then you still need to work on your configuration.
I have my script set up to move the files to the default location than once a week I go to that folder and delete all those files if I don’t need them back I’m too Plex for review

thank you, can you share your config? Thank you very much

@mtungtn here you go, below.

{
“test”: false,
“Host”: “127.0.0.1”,
“Port”: “32400”,
“SectionList”: [2,6],
“IgnoreSections”: [1,3,5],
“LogFile”: “/share/CACHEDEV1_DATA/Plexcleaner/log.txt”,
“LogFileMode”: “”,
“trigger_rescan”: false,
“EmailLog”: false,
“EmailServer”: “”,
“EmailServerPort”: 25,
“EmailServerUseTLS”: false,
“EmailUsername”: “”,
“EmailPassword”: “”,
“EmailRecipient”: “”,
“Token”: “xxxxxxxxxxxxxxxxxxxxxxx”,
“Username”: “”,
“Password”: “”,
“Shared”: false,
“DeviceName”: “MediaServer”,
“RemoteMount”: “”,
“LocalMount”: “”,
“plex_delete”: true,
“similar_files”: false,
“cleanup_movie_folders”: false,
“minimum_folder_size”: 5,
“default_episodes”: 3,
“default_minDays”: 5,
“default_maxDays”: 30,
“default_action”: “move”,
“default_watched”: false,
“default_progressAsWatched”: 80,
“default_location”: “/share/CACHEDEV1_DATA/XfinityTVDeleted”,
“default_onDeck”: true,
“default_homeUsers”: “”,
“default_ignoreFolders”: [
“/share/CACHEDEV1_DATA/Multimedia/Movies”,
“/share/CACHEDEV1_DATA/Multimedia/Playon”,
“/share/CACHEDEV1_DATA/Multimedia/Photos”,
“/share/CACHEDEV1_DATA/Multimedia/Videos”
],
“ShowPreferences”: {
“Q13 News at 9”: {
“onDeck”: false,
“maxDays”: 1,
“minDays”: 1,
“episodes”: 1,
“location”: “/share/CACHEDEV1_DATA/XfinityTVDeleted”,
“action”: “move”,
“watched”: false
},
“Dr. Phil”: {
“onDeck”: false,
“maxDays”: 230,
“minDays”: 100,
“episodes”: 10,
“location”: “/share/CACHEDEV1_DATA/XfinityTVDeleted”,
“action”: “move”,
“watched”: false
},
“Later … with Jools Holland”: {
“action”: “keep”
}
},
“MoviePreferences”: {
“action”: “keep”,
“location”: “”,
“minDays”: 21,
“onDeck”: true,
“watched”: true
},
“Profiles”: {
“Profile 1”: {
“onDeck”: true,
“maxDays”: 30,
“minDays”: 10,
“homeUsers”: “”,
“episodes”: 3,
“location”: “/path/to/folder”,
“action”: “delete”,
“watched”: true
}
},
“Version”: 2.0,
“Client_ID”: “xxxxxxxxxxxxxxxxxxx”
}

1 Like

Thank you, I did it. The problem is that I don’t configure “MoviePreferences”: {…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.