diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-12-06 12:14:26 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-12-06 12:14:26 +0100 |
commit | 5f9b83944da7c531f82ace0ce9275c2661e7187e (patch) | |
tree | 82b90a6530efef3ee83158125831519ec94d36d2 /youtube_dl | |
parent | f6735be4da1da24be3a2d90461069d192900838a (diff) |
[ffmpeg] Improve version check and call it from hls (Fixes #4377)
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/downloader/hls.py | 4 | ||||
-rw-r--r-- | youtube_dl/postprocessor/ffmpeg.py | 6 | ||||
-rw-r--r-- | youtube_dl/utils.py | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py index 954beffd5..ad26cfa40 100644 --- a/youtube_dl/downloader/hls.py +++ b/youtube_dl/downloader/hls.py @@ -4,6 +4,7 @@ import os import re import subprocess +from ..postprocessor.ffmpeg import FFmpegPostProcessor from .common import FileDownloader from ..utils import ( compat_urlparse, @@ -32,6 +33,9 @@ class HlsFD(FileDownloader): return False cmd = [program] + args + ffpp = FFmpegPostProcessor(downloader=self) + ffpp.check_version() + retval = subprocess.call(cmd) if retval == 0: fsize = os.path.getsize(encodeFilename(tmpfilename)) diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index 9303b8378..965ded4c1 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -37,11 +37,11 @@ class FFmpegPostProcessor(PostProcessor): if not self._executable: raise FFmpegPostProcessorError('ffmpeg or avconv not found. Please install one.') - REQUIRED_VERSION = '1.0' + required_version = '10-0' if self._uses_avconv() else '1.0' if is_outdated_version( - self._versions[self._executable], REQUIRED_VERSION): + self._versions[self._executable], required_version): warning = 'Your copy of %s is outdated, update %s to version %s or newer if you encounter any errors.' % ( - self._executable, self._executable, REQUIRED_VERSION) + self._executable, self._executable, required_version) if self._downloader: self._downloader.report_warning(warning) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 5efb4c59a..2e70cc791 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1502,7 +1502,7 @@ def limit_length(s, length): def version_tuple(v): - return [int(e) for e in v.split('.')] + return tuple(int(e) for e in re.split(r'[-.]', v)) def is_outdated_version(version, limit, assume_new=True): |