handle NA in ffprobe duration extractor

This commit is contained in:
simon 2022-02-05 23:09:05 +07:00
parent 2bf9e9683b
commit 44af78b7e3
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -169,7 +169,11 @@ class DurationConverter:
capture_output=True,
check=True,
)
duration_sec = int(float(duration.stdout.decode().strip()))
duration_raw = duration.stdout.decode().strip()
if duration_raw == "N/A":
return 0
duration_sec = int(float(duration_raw))
return duration_sec
@staticmethod