(fix): catch ffmpeg errors in file tester

This commit is contained in:
Travis Abendshien
2024-07-25 11:54:44 -07:00
parent c6a5202c91
commit ad12d64f1e

View File

@@ -14,12 +14,16 @@ def is_readable_video(filepath: Path | str):
Args:
filepath (Path | str):
"""
probe = ffmpeg.probe(Path(filepath))
for stream in probe["streams"]:
if stream.get("codec_tag_string") in [
"drma",
"drms",
"drmi",
]:
return False
try:
probe = ffmpeg.probe(Path(filepath))
for stream in probe["streams"]:
# DRM check
if stream.get("codec_tag_string") in [
"drma",
"drms",
"drmi",
]:
return False
except ffmpeg.Error:
return False
return True