-
Notifications
You must be signed in to change notification settings - Fork 42
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_action = 'flag' # 'keep' | 'move' | 'copy' | 'delete' | 'flag'
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
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 = 0 # Number of episodes to keep
default_watched = True # True | False
default_onDeck = True # True | False
default_minDays ago will be deleted. If default_watched is True, then days from the last watched date
default_minDays = 0 # Minimum number of days to keep
default)maxDays ago will be deleted. If default_watched is True, then days from the last watched date
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
default_location = '' # /path/to/file
default_homeUsers specifies the home users that the script will try to check watch status of in Plex Home
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)
default_homeUsers = '' # 'Bob,Joe,Will' ##########################################################################
Only the settings that are being changed need to be given. The setting will match the default settings above
Ex: 'Show Name':{'episodes':3,'watched':True/False,'minDays':,'action':'copy','location':'/path/to/folder','homeUsers':'Billy,Bob,Joe'},
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.
Profiles = { "Profile 1": {"episodes": 3, "watched": True, "minDays": 10, "action": "delete", "location": "/path/to/folder", "onDeck": True, "maxDays": 30, 'homeUsers': ''} } ##########################################################################