Look like the form is back but could someones give me please github link?
Ya here it is:
@eskwire said:
Look like the form is back but could someones give me please github link?
@ngovil21 said:
Ya here it is:GitHub - ngovil21/Plex-Cleaner: A script to clean up movies and episodes in Plex Media Server
@The_Dogg said:
GitHub - ngovil21/Plex-Cleaner: A script to clean up movies and episodes in Plex Media Server
thanks
OK I just pushed out a new update to the master branch. I call it Profiles. Profiles can set for certain TV shows that you would like to apply the same settings to. It works through Plex Collection tags, so you can add shows to certain profiles through the Plex Web Interface.
To create a new profile, create one in your configuration file. An example Profile will be made after you run the script for the first time after updating. You can use all the same settings in Profiles that you could under ShowPreferences. Then all you need to do is add the TV show to the collection with the same name as the Profile through Plex Web. Try to keep profile names descriptive so you can easily manage new shows in the future.
Let me know if there are any problems.
Hi,
This is a great script but will it work with plex home when more then one user is using plex?
I would like the possibility to have an option that content gets deleted after all plex home members have watched it.
After a grace period etc.
Is that possible or is it possible to enhance the script to work like that?
Otherwise shows will be deleted before all family members have watched it.
The Script does not currently support multiple users. I can look to add multi-user support in a future version, but that will probably be some time as I am currently in school right now. If anyone has an implementation for it before I can get to it, send me a pull request on Github to the development branch.
Hi ngovil21,
That would be great!! I think this script screams for such an enhancement and especially with Plex media server being used more and more in a Plex home shared environment.
I do not know how much work it will be to implement but keep us posted on the progress when you start on it.
If you need a tester, count me in!
I am not a coder myself but can read the scripts and have a general understanding of the working of it.
Hi
Iāve been using this script since I discovered Plex about 5 months ago. I set it up first time no problem and even edited the batch file to run 4 successive autodelete.py files as I have a number of libraries. However, i recently had a little foray into the world of Windows 10, hated it and so have wiped the drive and reinstalled the same version of 8 I was using before. Now though, I canāt seem to get it to work. I am sure itāll be something iāve overlooked but Iāve looked at everything I can think of! Whenever I run the batch file now, each section of the log file (for each library) is just showing as section 1. I have ensured i have entered the correct section numbers on the relevant .py files but it continues to do so. I have also tried removing the multiple .py files and trying each library one at a timeā¦they STILL keep showing up as section 1. I am bamboozled. Could anyone please offer me some advice on where Iāve gone wrong?
Many thanks
Hi Barold, a lot in the script has changed in the last five months. I would like to know what version of the script you are using. Are you using my version from github found here:
If so you donāt need to run 4 alternative files for different libraries. You can list them in the SectionList option of the script. The only reason to run multiple scripts would be for deleting shows based on different users as that isnāt supported yet.
The settings in the script are now based off a configuration file, that needs to be in certain places. Either in the same directory as the script named Cleaner.conf or as a .plexcleaner file in the userās home directory.
If you arenāt using this version, then I suggest you try upgradingto it as itās the only version that is currently supported.
If you are still having issues with my script, could you PM me your log file and Cleaner.conf file.
I was using the one posted in the first comment of this topic by the lad Steven. Since posting my comment I have headed over to github and started reading your updated version. it looks a bit more complex (which is no bad thing) but it may take me a bit of time to get to grips with it.
Iāll download the scripts and see if I can run them. Iāll give you a PM if iām still having trouble. i appreciate that. Thanks. 
Ya the shift to PlexHome broke a lot of things from that version so I did a rewrite of the script. The basic setup would just be to clone the directory using git or download the entire zip file from GitHub and extract. Then copy the Cleaner.conf.default to Cleaner.conf and edit the settings in there. Refer to the PlexCleaner.py for what each setting means. You might have trouble with ShowPreferences, MovePreferences and Profiles because they have to be formatted a certain way, but they are more advanced features.
Donāt change the default_action flag to delete,move, or copy until you have fully tested and are satisfied with the settings. Good luck and let me know if you have any issues.
Hi again @ngovil21. OK, I have familiarised myself with your scrips and am pretty sure Iāve set everything up as it should be. Ran a couple of tests and got the results iād expect. i have now set the flag to ādeleteā and set a couple of videos to āwatchedā to make sure it works. I get the following error against each of the 2 videos within the log file:-
Error deleting file: <urlopen error [Errno 11001] getaddrinfo failed>
Any ideas?
Where are the files located? Are they on a remote location and does the user the script is run under have delete permissions? Could you PM me your log and Settings file and the actual name of the video files from Explorer?
I am so happy to have found this thread. I am in the process of setting this up and the --test flag is running well and returning expected results. My struggle is in the SectionList. Iām trying to run this so that I can let it know what to clean and what to skip.
Server is running on Mint 17.1 (14.04). I go to /usr/lib/plexmediaserver and try to run Plex\ Media\ Scanner --list and am getting nothing returned.
Any help would be greatly appreciated! Thanks!
PS- Iām a bit new to Linux, which might mean Iām missing something totally easy.
To get the Section ID, go to Plex Web and click on the library you want to scan. Then look at the URL in the addressbar. The Section ID will be the number at the end after /section/.
The URL should look something like this:
https://app.plex.tv/web/app#!/server/[Session_Hash]/section/2
In this example, the Section ID is 2.
@ngovil21 said:
To get the Section ID, go to Plex Web and click on the library you want to scan. Then look at the URL in the addressbar. The Section ID will be the number at the end after /section/.The URL should look something like this:
https://app.plex.tv/web/app#!/server/[Session_Hash]/section/2
In this example, the Section ID is 2.
Thank you so much! I feel like such a dope.
I wanted to message ngovil21 with this directly, but plex forums wonāt let me. Iām currently in the process of refactoring this script in a more OOP way with smaller functions; which should make it easier to test. I will also be adding the ability to delete watched items after X days after last watch date (the entire reason I went searching for a script like this in the first place).
You can see the progress as I code today, and the next couple days, at: https://github.com/morganhein/Plex-Cleaner/blob/master/PlexCleanerWithBleach.py
I plan on making a pull request and letting you do with the rewrite as you see fit.
On that note, anything you wish was factored differently, or behaved differently? features? I donāt want to spend too much time on this, but iām already here so might as well.
Also, changes I plan on implementing:
- Removing the ability to change script settings inside the script itself, all custom arguments will have to come from cli arguments or the config file
- All output automatically gets sent to a logger, which can be handled by syslog or whatever windows uses. Nothing will print to screen. This is to facilitate setting this script in a cron job and be able to see history in a log.
You can hit me up real time on freenode#plex, under username johnnyfive.
The edits so far looks nice. Looks really clean.
Deleting watched items after X days from last watched is actually what the script does if the watched flag is set. Logging is currently done to both the console and will be output to a log if a file is specified . Iāve added some support for home users that I havenāt pushed to Git yet, just testing it out, so you may want to integrate that better in a bit. Iāll push it to the development branch. checkMovie and checkShow could probably be combined. Efficiency wasnāt my focus with the script so a lot could be done there. Also maintaining support for Python 2 and 3 is a huge pain.
A command line interface is a good idea, but a config file will probably still be necessary for profiles and individual show settings.
Does it really? Well less to implement for me. I havenāt finished reading all the code, some of it is contextually complex.
Is this your first programming endeavor? It reminds me of when I started (also in Python). Most of the scripts I have written and released in the past I just wrote for python2, and used the 2to3 script when necessary for those that want 3. However, honestly, I have no intention of rewriting this with 3 in mind, if thatās something that you think is important iāll leave that up to you.