aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-10-26 16:46:34 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-10-26 16:46:34 +0100
commit488447455d3d90e1d83a7ebc2f9ce552e031e0d8 (patch)
tree3bff2f2bfd14fe4f784923bd4efcd7cb79dde9ad /youtube_dl/utils.py
parentd28b5171541aaef568372a78384d6a5c862b2369 (diff)
[ffmpeg] Warn if ffmpeg/avconv version is too old (Fixes #4026)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 9287edd8d..6c0c39ca5 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1723,3 +1723,16 @@ def limit_length(s, length):
if len(s) > length:
return s[:length - len(ELLIPSES)] + ELLIPSES
return s
+
+
+def version_tuple(v):
+ return [int(e) for e in v.split('.')]
+
+
+def is_outdated_version(version, limit, assume_new=True):
+ if not version:
+ return not assume_new
+ try:
+ return version_tuple(version) < version_tuple(limit)
+ except ValueError:
+ return not assume_new