]> code.delx.au - webdl/blobdiff - common.py
Fix for avprobe
[webdl] / common.py
index 17c160df566648c7f841e107ffb5df82063ff1c8..ead72c645216692195eb2284c258e70ea29f0c30 100644 (file)
--- 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)