From: James Bunton Date: Thu, 9 Feb 2017 21:36:08 +0000 (+1100) Subject: Fix for avprobe X-Git-Url: https://code.delx.au/webdl/commitdiff_plain/0a8b0318cb27682375b0f6526d0075b5ddfeed34?hp=70f6f85e184c7cb59d1cd6031973373b0f65cf8f Fix for avprobe --- diff --git a/common.py b/common.py index 17c160d..ead72c6 100644 --- a/common.py +++ b/common.py @@ -219,7 +219,9 @@ def get_duration(filename): output = subprocess.check_output(cmd).decode("utf-8") for line in output.split("\n"): if line.startswith("duration="): - return float(line.split("=")[1]) + return float(line.split("=")[1]) # ffprobe + if re.match(R'^[0-9.]*$', line): + return float(line) # avprobe raise Exception("Unable to determine video duration of " + filename)