Hi,
I’ve been using this script for quite a while now with good success, both deleting watched episodes and keeping series others still want to see.
I just recently updated to the latest version from git and now it has started to misbehave…
Has anything changed (default value) concerning WHEN a watched episode will be deleted.
For example, I watched NCIS - S13E10 a few days ago.
The log says: Watched: 1 | Days Since Last Viewed: 5 | On Deck: False
[Keeping] …
How many days will it take until the file is deleted? All values in the cfg-file are default except for the
When I check the history in PlexPy I can see that it completely watched.
Is there some documentation of the settings in the cfg-file?
@Old-T The onDeck behavior has been changed, which is set to True by default (going to change that in the future). An episode will not be deleted from the deck if the next episode is on deck to prevent the next episode from being removed from the deck. The log currently doesn’t give the correct status of onDeck in this case, which I will fix as well. If you do not care about episodes being on deck you can you can set default_onDeck to False in the cfg-file.
If that doesn’t fix it, could you run the script with --debug flag and pm me the log? Remove any identifying information you want and rename the extension to .txt.
@eskwire said:
I dont like ondeck system, i prefer he only show me new episode if i have the previous or not.
Well from what I understood, if you delete the previous episode, then the onDeck system won’t work. If you would prefer the older episode deleted, then maybe you don’t really want to use onDeck and should probably set it to false.
@spupuz said:
does this work also only for movies and not for tv shows?
It does work with TV shows. You need to specify the TV library and there are options to customize by show or profiles. Read the script comments for information on the settings. You can also look at the Wiki on Github for explanation of the settings.
I’m liking this, however I can’t seem to find an easy (and fast) way of saving movies or tvshows, besides editing the config. I would like it if I could point it to paths that the cleaner should scan.
I know there is an option to create an entire new section of movies (and of tvshows) consisting of films and shows I don’t want deleted, but that leaves me with two additional libraries just for the sake of the cleaner.
What I would like is if I could point the cleaner to take action on one folder of movies and ignore other folders with movies (which Plex Scans), and the same for tv-shows (take action on one certain folder and ignore the rest). That means I could save some movies and shows that I enjoy and often revisit, and I could easily move files and folders to those locations (saving them from the Cleaner).
The reason for this is I currently have a TV folder and a Movie folder in which I want shows and movies to be auto-deleted and another set of folders that I want to keep indefinetly
Furthermore, if that was possible I would like it to run on multiple of these folders with varying settings. But, most important for me is tbeing able to specify folders that it shouldn’t scan.
@Smathev I won’t be able to have different settings for different folders, because the script doesn’t work by scanning folders. It scans the Plex API, which has its own database. I could ignore files that are in certain folders. I’ll add this feature within the next week.
I haven’t implemented this for Movie sections yet, but could you try the Profile section of the Config file? To set this up, you would create a Profile in the config with a set of settings. Then you can create a Collection with the same name as the Profile you created. Shows that are in the collection will use the Profile settings. This can allow you to configure shows using PlexWeb. A warning, if all the episodes of a show are deleted, then Plex won’t remember the collection tag for the series if the is readded, so you would need to keep at least 1 episode for each show.
@ngovil21 - Hi man, thanks for the reply. I greatly appreciate your thoughts. The feature you’re adding - “ignoring files in certain folders” sounds exactly like what I was asking for.
So, Plex Cleaner should delete/clean files in folders /Movies 2TB/ and /Series 2TB/ and ignore every other folder like /Samsung1-Movies/ and /Samsung1-TVShows/ and it sounds like I could tell it to ignore files/folders if they are placed in Samsung1-movies/ or Samsung1-TVShows.
That sounds awesome, I can’t wait to try the new feature
Well, the way I was planning it would be a list of folders that the script will ignore any files that start with the given file location. So if you set /home/user/movies/ignore as the ignore folder, then any folders or movies in there will not be deleted. Other movies in /home/user/movies/ would be deleted. You could also let /home/user/archive be the ignored folder and have both folders in the same Plex Library.
@Smathev said: @ngovil21 Yes, yes, yes, please! That sounds exactly like what I was thinking and hoping for
I have added in an option default_ignoreFolders. Update the script from Github and run the script to update your config file. You can then specify different absolute directory paths to ignore. All files are still checked, but files in ignored directories should print [IGNORED] in the logs.
No major updates. Only two new features have been added: ignoring folders from being processed and the ability to append new logs instead of writing. If you want any of these features then update, otherwise you can let it be.
I think the script is fairly stable. No major changes are planned, unless I release my custom configuration file. But I’m worried that may cause more problems than it helps.
@ngovil21 - hey man, it sounds awesome, and I just started playing around with it, unfortunately, I don’t see that option in the config-file, did you add it in the config or could you provide me with the entire syntax for such a setting.
Preferably how to add multiple directories, since I have to different drives, IE. /Volumes/TVshows-Samung/Keepers and /Volumes/Movies-Samsung/Keepers that I want ignored.
Thanks in advance.
EDIT - Okay, I just saw that you already added it in the .plexcleaner-config and not in the default config bundled in the github install, so I’m playing around with it, but it fails for some reason.
This is the error provided when I run the script:
Traceback (most recent call last):
File “PlexCleaner.py”, line 835, in
options = json.loads(opt_string)
File “/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py”, line 339, in loads
return _default_decoder.decode(s)
File “/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py”, line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py”, line 382, in raw_decode
raise ValueError(“No JSON object could be decoded”)
ValueError: No JSON object could be decoded
I’m on mac with the most recent update, if that’s any help
@ngovil21 Ok, my troubleshooting is that I’m doing something wrong when I’m adding folders to be ignored. When I don’t add them it runs perfect, but whenever I add them it fails with the following error:
Traceback (most recent call last):
File “PlexCleaner.py”, line 835, in
options = json.loads(opt_string)
File “/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py”, line 339, in loads
return _default_decoder.decode(s)
File “/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py”, line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py”, line 382, in raw_decode
raise ValueError(“No JSON object could be decoded”)
ValueError: No JSON object could be decoded
I’m certain the folders are correct…
This is what I’m shooting for:
Plex scans /Volumes/TVShows-Samsung/ for all TVShows.
Within /Volumes/TVShows-Samsung/ there is a folder called KeeperShows (or whatever) so the path to that folder is /Volumes/TVShows-Samsung/KeeperShows/ and that’s the folder I want Plex-Cleaner to ignore, how do I add that to “default_ignoreFolder”?
… And, the same thing for a volume called /Volumes/Movies-Samsung/ with a folder KeeperMovies/ as a sub-folder.
If it isn’t possible to have an ignored folder as a subfolder of a directory that Plex scans, then I’m fine with having two folders on the root of the drive (one for scanned files, and one for ignored files), and have Plex scan both folders, but whatever I do it throws the above error
it seems unable to parse the config file, so there’s an issue with your formatting. default_ignoreFolders is a list so it should look something like this:
One word - Awesome! It works now, and it correctly ignores files in the specified ignoreFolders. I haven’t had the guts to run it without the --test flag, but it appears to be working.
It exits with an error, but I’m not sure if that a big deal:
Traceback (most recent call last):
File “PlexCleaner.py”, line 984, in
changed += checkShow(DirectoryNode)
File “PlexCleaner.py”, line 782, in checkShow
location=show_settings[‘location’]):
File “PlexCleaner.py”, line 370, in performAction
if file.startswith(path):
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe2 in position 102: ordinal not in range(128)
@Smathev Glad it is working. The error you are getting is a problem with Unicode characters. Could you try running the script with python3? Python3 usually handles unicode strings better.