video_utils.watchdogs package
Submodules
video_utils.watchdogs.base module
Watchdog for MakeMKV output
A watchdog is defined that monitors direcory(ies) for files output by MakeMKV so that these files can be transcoded and add to Plex.
- class video_utils.watchdogs.base.BaseWatchdog(*args, **kwargs)
Bases:
FileSystemEventHandlerBase watchdog class for package
- join()
Method to wait for the watchdog Observer to finish.
- on_created(event)
Method to handle events when file is created.
- Parameters:
() (event) – Watchdog event
- Returns:
None.
- on_moved(event)
Method to handle events when file is created.
- Parameters:
() (event) – Watchdog Event
- Returns:
None.
- set_file_exts(file_ext, default_ext)
Get file extension(s) to use
- Parameters:
file_ext (str) – File extenion to defined by user
default_ext (tuple) – Default file extensions defined in code
- Returns:
File extensions for valid files
- Return type:
tuple
video_utils.watchdogs.makemkv module
Watchdog for MakeMKV output
A watchdog is defined that monitors direcory(ies) for files output by MakeMKV so that these files can be transcoded and add to Plex.
- class video_utils.watchdogs.makemkv.MakeMKV_Watchdog(*args, **kwargs)
Bases:
BaseWatchdogWatchdog for conversion of MakeMKV output
- video_utils.watchdogs.makemkv.cli()
Entry point for CLI
video_utils.watchdogs.music module
Watchdog for new music
- class video_utils.watchdogs.music.Music_Watchdog(outdir, *args, **kwargs)
Bases:
BaseWatchdogWatchdog of new music files
video_utils.watchdogs.plex_dvr module
Watchdog for Plex DVR recordings
The watchdog class defined here will monitor for new Plex DVR recordings and re-encode the file AFTER it is moved to its final location
- class video_utils.watchdogs.plex_dvr.PlexDVRWatchdog(*args, **kwargs)
Bases:
FileSystemEventHandlerClass to watch for, and convert, new DVR recordings
- PURGE_INTERVAL = datetime.timedelta(seconds=10800)
- check_recording(fpath)
A method to check that newly created file is a DVR recording
- Parameters:
fpath (str) – Path to newly created file from event in on_created() method
- Keyword Arguments:
None –
- Returns:
- True if file is a recording (i.e., it’s just been moved),
False otherwise
- Return type:
bool
- join()
Method to wait for the watchdog Observer to finish.
The Observer will be stopped when _sigintEvent or _sigtermEvent is set
- on_created(event)
Method to handle events when file is created.
- on_moved(event)
Method to handle events when file is moved.
- video_utils.watchdogs.plex_dvr.SLEEP = 1.0
The following code ‘attempts’ to add what should be the site-packages location where video_utils is installed to sys.path
- video_utils.watchdogs.plex_dvr.cli()
Entry point for CLI