From 44af78b7e30d623f486b007cbcf4b88140130d3d Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 5 Feb 2022 23:09:05 +0700 Subject: [PATCH] handle NA in ffprobe duration extractor --- tubearchivist/home/src/ta/helper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/ta/helper.py b/tubearchivist/home/src/ta/helper.py index 4788636..d577dcd 100644 --- a/tubearchivist/home/src/ta/helper.py +++ b/tubearchivist/home/src/ta/helper.py @@ -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