Git Product home page Git Product logo

plex-cleaner's People

Contributors

johnybradshaw avatar ngovil21 avatar nitrikx avatar pfluger42 avatar stevenflesch avatar timwaterhouse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plex-cleaner's Issues

[RFE] List deleted/affected files in summary

Hi!

First, thanks so much for PlexCleaner!

Low priority, but it'd be great to have an option to list the files that were flagged/deleted in the summary. If you have a large library, it can be cumbersome to search for affected files among hundreds of "[Keeping]" entries. :)

Again, low priority, there's always grep, but if you end up refactoring the summary someday, I'd love to see this added. Thanks again!

Configuration File Requires ShowPreferences and Show Preferences

The default configuration file seems to require both. If I just have ShowPreferences: {}, it requires Show Preferences: {}. Because of this, I'm not quite sure where to put the real show preferences.

My config, as it stands today, doesn't delete anything, despite meeting the criteria. I notice this specifically in the Movies section (2), but it also looks like it's happening in TV (1). I've verified, via the log, that it is processing the Movies section, but never actually removes anything.

Here is my config.

{ "Host": "", "Port": "", "SectionList": [1,2], "IgnoreSections": [], "LogFile": "c:\plex_script\cleaner.log", "LogFileMode": "", "trigger_rescan": true, "Token": "mytokenhere", "Username": "", "Password": "", "Shared": false, "DeviceName": "", "RemoteMount": "", "LocalMount": "", "plex_delete": false, "similar_files": false, "cleanup_movie_folders": true, "minimum_folder_size": 30, "default_episodes": 0, "default_minDays": 14, "default_maxDays": 0, "default_action": "delete", "default_watched": true, "default_progressAsWatched": 0, "default_location": "", "default_onDeck": true, "default_homeUsers": "", "default_ignoreFolders": [], "ShowPreferences": { "Mr. Robot": { "action": "keep" }, "Silicon Valley": { "action": "keep" }, "Show Preferences": {} }, "MoviePreferences": { "action": "delete", "minDays": "2", "watched": true, "onDeck": true }, "Profiles": { }, "Version": 1.93 }

You can see that Show Preferences is in the ShowPreferences dictionary.

Add Option to Only Send Email if Files are Deleted

I've amended my copy of PlexCleaner.py so that I'm emailed only when files have been deleted.

Might it be worth adding this to the default script for everyone's use; or at least adding this as an option to the config file?

# Email Log
if Settings['EmailLog']:
    try:
        EmailContents = [] # Text of email.
        EmailContents.append("<pre>")
        EmailContents.append("----------------------------------------------------------------------------")
        EmailContents.append("                Summary -- Script Completed")
        EmailContents.append("----------------------------------------------------------------------------")
        EmailContents.append("\n")
        EmailContents.append("  Total File Count      " + str(FileCount))
        EmailContents.append("  Kept Show Files       " + str(KeptCount))
        EmailContents.append("  On Deck Files         " + str(OnDeckCount))
        EmailContents.append("  Deleted Files         " + str(DeleteCount))
        EmailContents.append("  Moved Files           " + str(MoveCount))
        EmailContents.append("  Copied Files          " + str(CopyCount))
        EmailContents.append("  Flagged Files         " + str(FlaggedCount))
        EmailContents.append("  Rescanned Sections    " + ', '.join(str(x) for x in RescannedSections))
        if len(ActionHistory) > 0:
            EmailContents.append("\n")
            EmailContents.append("  Changed Files:")
            for item in ActionHistory:
                EmailContents.append("  " + str(item))
        if len(ErrorLog) > 0:
            EmailContents.append("\n")
            EmailContents.append(" Errors:")
            for item in ErrorLog:
                EmailContents.append("  " + str(item))
        EmailContents.append("\n")
        EmailContents.append("----------------------------------------------------------------------------")
        EmailContents.append("</pre>")
        if len(ActionHistory) > 0:
            sendEmail(Settings["EmailUsername"], Settings["EmailRecipient"], "Plex-Cleaner.py Log", "\n".join(EmailContents), Settings["EmailServer"], Settings["EmailServerPort"], Settings["EmailUsername"], Settings["EmailPassword"], Settings["EmailServerUseTLS"])
        log("")
        if len(ActionHistory) > 0:
            log("Email of script summary sent successfully.")
        if len(ActionHistory) == 0:
            log("Email of script summary was not sent because no files were deleted.")
    except Exception as e:
        log(e, True)
        log("Could not send email.  Please ensure a valid server, port, username, password, and recipient are specified in your Config file.")
        if debug_mode:
            log(str(traceback.format_exc()))

changed hadrdrive now choose. section skips

hi i cloned my hardrive on a ssd and everything is working expect plex cleaner which i now see the follwoing in the log

INFO:root:** Script started 12-07-2016 10:23:19PM
INFO:root:
INFO:root:----------------------------------------------------------------------------
INFO:root: Detected Settings
INFO:root:----------------------------------------------------------------------------
INFO:root:Host: http://127.0.0.1
INFO:root:Port: 32400
INFO:root:Section List Mode: User-defined
INFO:root:Operating on user-defined sections: 3
INFO:root:Failed to load Section 3. Skipping...
INFO:root:
INFO:root:----------------------------------------------------------------------------
INFO:root:----------------------------------------------------------------------------
INFO:root: Summary -- Script Completed Successfully
INFO:root:----------------------------------------------------------------------------
INFO:root:
INFO:root: Total File Count 0
INFO:root: Kept Show Files 0
INFO:root: On Deck Files 0
INFO:root: Deleted Files 0
INFO:root: Moved Files 0
INFO:root: Copied Files 0
INFO:root: Flagged Files 0
INFO:root: Rescanned Sections
INFO:root:
INFO:root:----------------------------------------------------------------------------
INFO:root:----------------------------------------------------------------------------

plex is still accessed via 127.0.0.1
what is going wrong?

Script on htpc server on nvidia?

Hi,
I'm wanting to play 4K but my pc won't cope with it. Is it possible to run this script on my pc with the plex server on a nvidia shield?

All my content will remain on the PC or my NAS

Many thanks

ssl support

this a great script for cleaning plex. but the only thing missing is ssl.

Integrating the script in a web service

I would like to know if integrating this script in a web service (to configure it) would be interesting or not?

In the case it is, should I push the sources in this repo? Or create separated repo that uses this repo (submodule)?

Error when running with Python3

Hello,

i had used Plex-Cleaner for the last few months with Python2 for my tv section. Now i start using it for my movie section too. Now i have the error with foreign characters, like in Issue #17

I tried to run it with --reload_encoding, but got the same problem.

When i try to run Plex-Cleaner with Python3, i have the error:
`
Traceback (most recent call last):
File "/home/plex/scripts/Plex-Cleaner/PlexCleaner.py", line 190, in
from urllib.Error import HTTPError
ImportError: No module named 'urllib.Error'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/plex/scripts/Plex-Cleaner/PlexCleaner.py", line 193, in
from urllib2 import HTTPError
ImportError: No module named 'urllib2'
`

python3-urllib3 is installed on my System. I use Ubuntu 16.04.

Functionality Request

Sorry, didn't know how to send you suggestions for improving the Plex-Cleaner script. Here's what would help me:

  1. Ability to retain the folder structure relative to the Library Root folder when moving or copying
  2. Ability to run a command line with filename substitution after a move/copy or in place of.

The reason I ask, my cleaning process is to recode into x265 onto a slow backup drive which is picked up by my Plex server as it's Archive folders.

Error deleting file: HTTP Error 400: Bad Request

I have seen this same error posted but I could not find the solution applied. Script did work, now it does not. Error appears in the TV Section. However, the script does succesfully delete folders in the Movie Sections as part of the Cleanup (folders < 30Mb)

example:
Have I Got News for You - S54xE007 - Stephen Mangan, Steph McGovern, Jo Caulfield | Viewed: 1 | Days Since Last Viewed: 16 | On Deck: False
Error deleting file: HTTP Error 400: Bad Request

Some episodes that I watched days/week ago are "Days Since Last Viewed: 0"

Hi,

I recently installed your script on my NAS and I'm pretty happy about it. I've one issue still:

Some shows that I've already watched(By example here I've two episode of the same tv show, one I watched last week, one I watched this week), are indicasted as following:

--------- Section 2: S?ries TV -----------------------------------
XXXX | Viewed: 1 | Days Since Last Viewed: 0 | On Deck: False
[Keeping] /media/RAID/public/Downloads/Series/YYYY/Season 10/XXXX.mkv

VVVV | Viewed: 1 | Days Since Last Viewed: 0 | On Deck: False
[Keeping] /media/RAID/public/Downloads/Series/YYYY/Season 10/VVVV.mkv

They are indicasted as having been viewed once, but there is no days since last viewed. Since I've configured to delete everything that is older than 1 day, they are never deleted. Any idea what could going wrong?

Or what I can give you to help the debug?

Option to Exclude deleting Movied

I do not want PlexCleaner to delete movies, even if watched. I prefer to do this manually. So I ignore the Movie section in the scan. But then the option to cleanup Movie Folders if under certain size is ignored.
How can I include the Movie sections in the scan, but not have PlexCleaner delete watched movies?

Token in Cleaner.conf

When the token is set in the configuration file. It is ignored inside of python script.

Where to save script on NAS

Hi, I am using Ples on NAS.

Where to place this script? I have supposed that it could be Plug-Ins directory. But if I tried it nothing happened. Does it work like o plugin (agent)?

Thx you for explanation.

Last seen episode doesnt get deleted.

Hi,

the script works like a charm, but for some reason the last watched episode doesnt get moved or deleted.

Any Ideas?

"default_episodes": 0,
"default_minDays": 0,
"default_maxDays": 0,
"default_action": "move",
"default_watched": true,
"default_progressAsWatched": 1,
"default_location": "E://delete",
"default_onDeck": true,
"default_homeUsers": "",

Auto-running every 5 minutes on Mac

This isn't an issue, but I've created a launch agent, to make Plex Cleaner to run automatically every 5 minutes.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.ngovil21.plexcleaner</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/python</string>
        <string>/path/to/your/plexcleaner/PlexCleaner.py</string>
    </array>
    <key>StartInterval</key>
    <integer>300</integer>
</dict>
</plist>

save this file as com.ngovil21.plexcleaner.plist on your Desktop, then run in terminal:

cp ~/Desktop/com.ngovil21.plexcleaner.plist ~/Library/LaunchAgents/com.ngovil21.plexcleaner.plist
sudo chmod 0600 ~/Library/LaunchAgents/com.ngovil21.plexcleaner.plist
sudo chown root ~/Library/LaunchAgents/com.ngovil21.plexcleaner.plist
launchctl load ~/Library/LaunchAgents/com.ngovil21.plexcleaner.plist

In Yosemite, and greater, modifying the access permissions and changing the ownership, lines 2 and 3, are necessary. Mavericks and lower, you can leave them out.

I've adapted this from the installation instructions for PlexPy, so it's probably easy to do the same if you're on Windows or Linux.

Also, the interval is set to 300 seconds, or 5 minutes. You could change that to anything you want.

Keep Folder Structure

Is it possible to keep current folder structure when moving files? Right now I have it to move but it dumps all files into the default location.
Example Currently :
/data/plex/Movies/Movie Title.mp4
/data/plex/Movies/Movie Title 2.mp4
Wanting:
/data/plex/Movies/Movie (year)/Movie Title.mp4
/data/plex/Movies/Movie 2 (year)/Movie Title 2.mp4

Error in 1.9.4 - NameError: name 'reload' is not defined

Upgraded PlexCleaner.py from 1.9.3 to 1.9.4 and now getting error:

C:\PlexCleaner>PlexCleaner.py
Traceback (most recent call last):
File "C:\PlexCleaner\PlexCleaner.py", line 809, in
reload(sys)
NameError: name 'reload' is not defined

Traceback when processing

I'm seeing the following error when running, with episodes for this show.

Let me know what additional information I can provide to assist:

Dirk Gently's Holistic Detective Agency - S01xE002 - Lost and Found | Viewed: 1 | Days Since Last Viewed: 3 | On Deck: False
Traceback (most recent call last):
File "/Users/ksnider/scripts/PlexCleaner.py", line 984, in
changed += checkShow(DirectoryNode)
File "/Users/ksnider/scripts/PlexCleaner.py", line 782, in checkShow
location=show_settings['location']):
File "/Users/ksnider/scripts/PlexCleaner.py", line 370, in performAction
if file.startswith(path):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 43: ordinal not in range(128)

Issues Decoding ASCII Characters

If I have shows in my Plex library which contain accented characters, then the script fails due to an ASCII decode error.

Star Trek: The Next Generation - S03xE013 - D?j? Q | Viewed: 1 | Days Since Last Viewed: 5 | On Deck: False
Traceback (most recent call last):
  File "PlexCleaner.py", line 1158, in <module>
    changed += checkShow(DirectoryNode)
  File "PlexCleaner.py", line 856, in checkShow
    location=show_settings['location']):
  File "PlexCleaner.py", line 418, in performAction
    if file.startswith(path):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 86: ordinal not in range(128)

Deleting these shows from my library resolves this issue but is not ideal.

Error message about missing files

I get the following error message when PlexCleaner tris to remove files.

INFO:root:Mindhunter - S01xE002 - Episode 2 | Viewed: 1 | Days Since Last Viewed: 2 | On Deck: False
INFO:root:Finding files similar to: M:\TV Shows\Mindhunter\Season 1\Mindhunter - S01E02 - Episode 2*
INFO:root:**[DELETED] M:\TV Shows\Mindhunter\Season 1\Mindhunter - S01E02 - Episode 2.mkv
DEBUG:root:Error deleting file: [WinError 2] The system cannot find the file specified: 'M:\TV Shows\Mindhunter\Season 1\Mindhunter - S01E02 - Episode 2.mkv'
DEBUG:root:Error deleting file: [WinError 2] The system cannot find the file specified: 'M:\TV Shows\Mindhunter\Season 1\Mindhunter - S01E02 - Episode 2.mkv'
INFO:root:

It seems like its trying to delete the same file 3 times. Actually there are three files for each episode but it only deletes the mkv file but leaves the other two. One file is called: Mindhunter - S01E02 - Episode 2-thumb.jpg

It seems like it detects that there are two additional files but then it gets the names wrong.

Stephan

Error When Processing Foreign Characters

Seems that the script doesn't properly handle characters with accent marks such as Pokémon(probably related to my other issue)

Pok?mon - S01xE001 - Pok?mon! I Choose You! | Viewed: 1 | Days Since Last Viewed: 68 | On Deck: False
Cannot print message

Pok?mon - S01xE002 - Pok?mon Emergency! | Viewed: 1 | Days Since Last Viewed: 68 | On Deck: False
Cannot print message

Shared Users Not Updating Views

I may have something misconfigured but I can't figure out what just yet. I have the script running on a cron job and appending the log. What I've noticed over several days is users are viewing movies which I confirm with PlexPy but the Days Since Viewed and Viewed values are not updating.
I have "Shared": true, set in Cleaner.conf and now 'Shared = True' set in PlexCleaner.py since the .conf wasn't doing it.
Any idea what's going wrong?

output.log

PlexPy

Cleaner.conf

{
  "Host": "192.168.1.92",
  "Port": "32400",
  "SectionList": [1],
  "IgnoreSections": [],
  "LogFile": "/mnt/Plex/Plex-Cleaner/output.log",
  "LogFileMode": "append",
  "trigger_rescan": false,
  "Token": "xxxxxxxxxxxxxxxxxxxxx",
  "Username": "",
  "Password": "",
  "Shared": true,
  "DeviceName": "",
  "RemoteMount": "",
  "LocalMount": "",
  "plex_delete": false,
  "similar_files": false,
  "cleanup_movie_folders": true,
  "minimum_folder_size": 30,
  "default_episodes": 0,
  "default_minDays": 14,
  "default_maxDays": 0,
  "default_action": "flag",
  "default_watched": true,
  "default_progressAsWatched": 0,
  "default_location": "",
  "default_onDeck": true,
  "default_homeUsers": "",
  "default_ignoreFolders": ["/mnt/Media/Movies/Archive"],
  "MoviePreferences": {
    "action": "delete",
    "location": "/mnt/Media/Movies",
    "minDays": 183,
    "onDeck": true,
    "watched": false
  },
  "Version": 1.93
}

Follow symlinks/hardlinks?

I run a script which scans my download folder and creates symlinks/hardlinks with proper folder/naming structure for Plex, while allowing the original files to keep seeding. Is it possible to have the script follow the links and delete the original files too?

Cannot reach server

After updating to the latest version, I am seeing an unhelpful error message: 'Cannot reach server!'

I can reach my Plex server at the host and port in the config, and I'm not using PlexHome or any local username and password.

cleaner.log.txt

Issue getting tokens for home users

I have a local homeUser that the token is not correctly retrieved for.

after the call to getPlexHomeUserTokens() on ln 674 "toke" should be set by seeing if the user is in the dictionary like in the next elif statement on ln 675.

Exclude a category

Hi
Your tool seems great but I wonder if it was possible to exclude a category ?

My concern is that I want to delete all the movies already seen but my kids need to watch again and again and again cartoons.

If it's possible can you explain me ?

Thanks a lot

Multi user configs in one file

I have 2 invited shared users that use my Plex and I have managed to get a separate config file that allows me to target those users and it seems to be working great.

My question is: Can I amalgamate these users setting into one config file?

finding files similar to:

When running the script, when it finds a match, there is a long pause and it says : "Finding files similar to: \my network location."

I have set this "similar_files": false. No change. then true just for giggles. Same result. everything is working, there is just that pause.

Is this business as usual or can i speed it up?
newest master version of script, cloned today. windows 10.

Unable to define SectionList using name of Plex library

In the configuration for SectionList, I wanted to target only my Plex library TV Shows (To Watch), so I set it to:

SectionList = ["TV Shows (To Watch)"]  # Sections to clean. If empty all sections will be looked at

When running the script, it errors and doesn't run. Here's a snippet of the output:

Host: http://127.0.0.1
Port: 32400
Section List Mode: User-defined
Operating on user-defined sections: TV Shows (To Watch)
HTTP Error 400: Bad Request
HTTP Error 400: Bad Request
HTTP Error 400: Bad Request
HTTP Error 400: Bad Request
HTTP Error 400: Bad Request
HTTP Error 400: Bad Request
Failed to load Section TV Shows (To Watch). Skipping...

After a bit of tinkering, I found that by going to http://127.0.0.1:32400/library/sections on my Plex server, in the returned XML file finding the library, and noting the key attribute. Here's a screenshot:

Screenshot of the XML file

I used that value instead:

SectionList = [1]  # Sections to clean. If empty all sections will be looked at

and the script runs successfully. Here's a snippet of the output:

Host: http://127.0.0.1
Port: 32400
Section List Mode: User-defined
Operating on user-defined sections: 1

--------- Section 1: TV Shows (To Watch) -----------------------------------

If this is the case (if you're required to use the key attribute rather than the name of the library), it should be documented in the project readme. Or, if I'm doing something wrong, let me know the proper way to define SectionList.

Thanks for making a great Python script!

Allow 'any' home user

Would like the ability to specify that any home user can count as watched, currently if home_users is blank, no home users are checked at all.

Doesn't support unicode

Seems like the script doesn't like unicode/UTF-8 in filenames, which otherwise seem to work okay.

[NOT FOUND] S:\Welcome to Sweden (2014)\Welcome.to.Sweden.2014.S02E10.Sexy.Dancing.Br├Âllopet.mkv

Some files stay flagged for a very long time

While others are deleted right after the 3 day delay I specified. Example:

################ (2015) | Viewed: 1 | Days Since Viewed: 240 | On Deck: False **[FLAGGED] /mnt/media/Movies/####### (2015)/################# (2015).mkv

What could be causing this?
Thank you!

move to NAS

hi,
i've just come across your scripts and i think its great. could i please request one change
there are certain shows i watch and move to my NAS to keep the rest i watch and delete.

i set up a shows in the ShowPreferences section and added the nas location yet it doesnt move anything.

could this please be added?

Section detection not working anymore

Since the last version (1.4.3.3433), the section detection is not working anymore. It just tells me that it failed to load section X.

Also, when you look in the address bar in Plex, the URL is not the same as it used to be. This is how it is now: ?key=%2Flibrary%2Fsections%2F6

Looks like an URL encode issue maybe?

Any clue?

Deleting empty movie folders - minimum size

Changing the size for "minimum folder size" appears to make no difference and the script always only target folders with a minimum size of 30mb (default). How can I increase this to 200mb?

"cleanup_movie_folders": true,
"minimum_folder_size": 200,

RESPONSE
Cleaning up orphaned folders less than 30MB in Section 3
**[Flagged]: /volume1/NAS/Movies/Alien (1979)/
Size 19813162 bytes

Error When Looking for "Empty" Movie Folders

Great Program but unfortunately if I set the "cleanup_movie_folders" to false everything works fine if I set it to true the following happens.

Cleaning up orphaned folders less than 30MB in Section 1
**[Flagged]: /media/Movies/Trading Places (1983)/
Size 2924304 bytes
**[Flagged]: /media/Movies/I Give It A Year (2013)/
Size 3025705 bytes
**[Flagged]: /media/Movies/Escape Plan (2013)/
Size 30211 bytes
**[Flagged]: /media/Movies/Primer (2004)/
Size 3 bytes
**[Flagged]: /media/Movies/Neighbors (2014)/
Size 2343609 bytes
**[Flagged]: /media/Movies/Rush (2013)/
Size 20593447 bytes
**[Flagged]: /media/Movies/Two Night Stand (2014)/
Size 2226141 bytes
**[Flagged]: /media/Movies/Nightcrawler (2014)/
Size 1086971 bytes
**[Flagged]: /media/Movies/Guest, The (2014)/
Size 1329303 bytes
Traceback (most recent call last):
  File "./PlexCleaner.py", line 943, in <module>
    changed = checkMovies(doc, Section)
  File "./PlexCleaner.py", line 609, in checkMovies
    cleanUpFolders(section, minimum_folder_size)
  File "./PlexCleaner.py", line 633, in cleanUpFolders
    size = getTotalSize(subfolder_path)
  File "./PlexCleaner.py", line 464, in getTotalSize
    total_size += getTotalSize(itempath)
  File "./PlexCleaner.py", line 460, in getTotalSize
    itempath = os.path.join(file, item)
  File "/usr/local/lib/python2.7/posixpath.py", line 80, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: ordinal not in range(128)

Pushbullet support

Would it be possible to add the possibility to send the log to pushbullet via an app token?

Filenames with Extended Characters

While running plex cleaner on Linux, I've hit a snag where if a directory exists with an extended character, such as a ã or ø. At first I just renamed the files to something else, but as I use plex cleaner more, I am finding more episodes that are popping up like this. The error I'm getting is:

$ ./PlexCleaner.py --test > out2.txt
Traceback (most recent call last):
File "./PlexCleaner.py", line 1271, in
changed += checkShow(DirectoryNode)
File "./PlexCleaner.py", line 952, in checkShow
log('[KEEPING] ' + getLocalPath(ep['file']))
File "./PlexCleaner.py", line 594, in getLocalPath
if file.startswith(Settings['RemoteMount']):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 61: ordinal not in range(128)

I'm guessing the variable string needs to be escaped, but I figured I can't be the only person having these issues so I don't want to hack the code.

Do not have the token for [username]

I'm trying to set this up for the first time and I'm using Show Preferences with specific homeUsers but everytime I run the script it says

Do not have the token for [username]. Please check spelling or report error on forums.

I've checked with this particular user and they have set all referenced episodes to watched. Only thing I noticed was that his username has capital letters whereas the error has it all listed in lowercase.

Here's my conf file

{ "Host": "ipaddress", "Port": "32400", "SectionList": [2], "IgnoreSections": [], "LogFile": "cleaner.log", "trigger_rescan": false, "Token": "api", "Username": "", "Password": "", "Shared": false, "DeviceName": "devicename", "RemoteMount": "", "LocalMount": "", "plex_delete": false, "similar_files": true, "cleanup_movie_folders": false, "minimum_folder_size": 30, "default_episodes": 0, "default_minDays": 0, "default_maxDays": 60, "default_action": "keep", "default_watched": false, "default_progressAsWatched": 0, "default_location": "", "default_onDeck": true, "default_homeUsers": "", "default_ignoreFolders": [], "ShowPreferences": { "@Midnight": { "minDays": 15, "maxDays": 30, "onDeck": true, "homeUsers": "UserName", "episodes": 5, "action": "delete", "watched": true }, "Show Preferences": {} }, "MoviePreferences": {}, "Profiles": {}, "Version": 1.92 }

Check for content rating

Is it possible to check for content rating so that the best movies will be kept?
eg. something like delete movie with rating < 3, that are older then 30 days and have been watched.

Days Since Last Viewed

If you re-import files that have been previously viewed Plex and the script recognize them as viewed but the days since last viewed gets reset so the script thinks it should keep the episode despite it being way older than the max days option(this of course may be the intended function and not an error at all just annoying when re-importing from an OLD hD)

Reign (2013) - S03xE009 - Wedlock | Viewed: 1 | Days Since Last Viewed: 0 | On Deck: False
[Keeping] /media/TVShows/Reign (2013)/S03E09 - Wedlock.mkv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.