Ignoring dot directories when importing modules. Raising error when ffprobe is not installed.

This commit is contained in:
Roland 2022-06-29 17:27:43 -06:00
parent f3b61f8c18
commit 862b12019b
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
3 changed files with 8 additions and 12 deletions

View file

@ -244,6 +244,8 @@ def get_video_duration(video_path: Path) -> Optional[int]:
video_path = Path(video_path)
if not video_path.is_file():
raise FileNotFoundError(f'{video_path} does not exist!')
if not FFPROBE_BIN:
raise SystemError('ffprobe is not installed!')
cmd = [FFPROBE_BIN, '-v', 'error', '-show_entries', 'format=duration', '-of',
'default=noprint_wrappers=1:nokey=1', str(video_path)]
@ -265,6 +267,8 @@ def check_for_video_corruption(video_path: Path) -> bool:
video_path = Path(video_path)
if not video_path.is_file():
raise FileNotFoundError(f'{video_path} does not exist!')
if not FFPROBE_BIN:
raise SystemError('ffprobe is not installed!')
cmd = [FFPROBE_BIN, str(video_path)]
try: