mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 19:36:20 -05:00
Ignoring dot directories when importing modules. Raising error when ffprobe is not installed.
This commit is contained in:
parent
f3b61f8c18
commit
862b12019b
3 changed files with 8 additions and 12 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue