-
Notifications
You must be signed in to change notification settings - Fork 43
Home
Welcome to the Plex-Cleaner wiki! This will explain the settings in the Script so you can get started!
Config = ""
Location of a config file to load options from, can be specified in the commandline with --config [CONFIG_FILE]
Host = ""
: This is the IP Address of the Plex Media Server, by default 127.0.0.1 will be used
Port = ""
: This is the Port of the Plex Media Server, by default 32400 will be used
SectionList = []
: These are the Sections to clean. If empty all sections will be looked at. To get the section id, go to Plex Web and click on the section. Then look at the address bar, the section id will be the number at the end. Put the section ids inside the brackets separated by commas.
IgnoreSections = []
: Sections to skip cleaning, for use when *SectionList is not specified
LogFile = ""
: Location of log file to save console output
trigger_rescan = true/false
: If enabled, this will rescan a section if changes were made to it
Use Username/Password or Token for servers with PlexHome To generate a proper Token, first put your username and password and run the script with the flag --test. The Token will be printed in the console or in the logs. Tokens are preferred so that you password is not in a readable file.
Shared is for users that you have invited to the server. This will use their watch information. Be careful with what the default show settings are because deleting files will be done by the OS. To help map the server for Shared users, you can specify the server friendly name or machine identifier.
Username = ""
: Your plex.tv username
Password = ""
: Your plex.tv password
Token = ""
: Alternatively you can use a plex.tv generated Token. You can create one as explained above.
Shared = False
: Is this a shared account on the server? Shared accounts won't have delete privileges through Plex
DeviceName = ""
: The Machine identifier or friendly name for the server. This can help the script identify the server if you have multiple plex servers attached to your account.
Remote Mapping
For use with managing a remote Plex Media Server that is locally mounted. This will replace the prefix of the remote file path with the local mount point.
RemoteMount = ""
Path on the remote server to the media files
LocalMount = ""
Path on the local computer to the media files
#DEFAULT SETTINGS PER SHOW These are the default actions that are applied to each show.
default_action can be set to 'delete','copy','move', 'keep'
delete' will delete the file from the system
'copy' will copy the file to the location given
'move' will move the file to the location given
'keep' will do nothing to the file
'flag' will do nothing to the file, but still keep track of stats
default_action = 'flag'
# 'keep' | 'move' | 'copy' | 'delete' | 'flag'
plex_delete if set to True will use the Plex API to delete files instead of using system functions
Useful for remote plex installations
plex_delete = False
# True | False
similar_files if set to True will try to move/copy/delete files with similar file names to the media file Note: delete_similar will not work with plex_delete
similar_files
= True # True | False
cleanup_movie_folders if set to True will delete folders in movie section path that are less than a certain size in megabytes that is set in minimum_folder_size. This is used to cleanup orphaned movie folders when a movie file has been deleted by the script or through Plex. Only scanned sections will be affected. CAUTION: If you have Plex libraries that are in subdirectories of other libraries, the subdirectory may be deleted!
cleanup_movie_folders = False
minimum_folder_size is the size in megabytes under which a movie folder will be deleted, set to much less, than your smallest movie file. If you keep a large amount of extra feature files, this value may need to be adjusted
minimum_folder_size = 30
default_episodes will keep a certain number of episodes for a show If the number of episodes is greater than the default_episodes, older episodes will be deleted unless other criteria such as default_watched, default_onDeck, default_minDays are not met
default_episodes = 0 # Number of episodes to keep
default_watched if set to False will be disabled. If set to True, only episodes that have been watched will be deleted if all other criteria are met
default_watched = True
# True | False
default_onDeck if set to False will be disabled. If set to True, episodes that are On Deck in Plex will not be deleted
default_onDeck = True
# True | False
default_minDays specifies the minimum number of days to keep an episode. Episodes added more than default_minDays ago will be deleted. If default_watched is True, then days from the last watched date will be used
default_minDays = 0
# Minimum number of days to keep
default_maxDays specifies the maximum number of days to keep an episode. Episodes added more than default)maxDays ago will be deleted. If default_watched is True, then days from the last watched date will be used
default_maxDays = 60
# Maximum number of days to keep an episode
default_location specifies the location that episodes will be copied or moved to if the action is such make sure this is the path to the directory on the local computer
default_location = ''
# /path/to/file
default_homeUsers specifies the home users that the script will try to check watch status of in Plex Home
This will check if all users in the list have watched a show. Separate each user with a comma
You may use 'all' for the home Users and the script will check watch status of all the users in the Plex Home (Including Guest account if enabled)
It is probably better to list the users explicitly
default_homeUsers = ''
# 'Bob,Joe,Will'
Customized Settings for certain shows. Use this to override default settings.
Only the settings that are being changed need to be given. The setting will match the default settings above
You can also specify an id instead of the Show Name. The id is the id assigned by Plex to the show
Ex: 'Show Name':{'episodes':3,'watched':True/False,'minDays':,'action':'copy','location':'/path/to/folder','homeUsers':'Billy,Bob,Joe'},
Make sure each show is separated by a comma. Use this for TV shows
ShowPreferences = { "Show 1": {"episodes": 3, "watched": True, "minDays": 10, "action": "delete", "location": "/path/to/folder", "onDeck": True, "maxDays": 30, "homeUsers":'Bob,Joe,Will'}, "Show 2": {"episodes": 0, "watched": False, "minDays": 10, "action": "delete", "location": "/path/to/folder", "onDeck": False, "maxDays": 30}, "Show 3": {"action": "keep"}, # This show will skipped "Show Preferences": {} # Keep this line }
Movie specific settings, settings you would like to apply to movie sections only. These settings will override the default settings set above. Change the default value here or in the config file. Use this for Movie Libraries.
MoviePreferences = { 'watched': default_watched, # Delete only watched episodes 'minDays': default_minDays, # Minimum number of days to keep 'action': default_action, # Action to perform on movie files (delete/move/copy) 'location': default_location, # Location to keep movie files 'onDeck': default_onDeck # Do not delete move if on deck }
Profiles allow for customized settings based on Plex Collections. This allows managing of common settings using the Plex Web interface.
First set the Profile here, then add the TV show to the collection in Plex.
Profiles = { "Profile 1": { "episodes": 3, "watched": True, "minDays": 10, "action": "delete", "location": "/path/to/folder", "onDeck": True, "maxDays": 30, "homeUsers": ""} }