aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/postprocessor
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-01-07 06:23:41 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-01-07 06:23:41 +0100
commitd70ad093af56330d19eabe54483cbbd44b1bf6c1 (patch)
treeb712aa68c300233f65c340a306289cbf97a720af /youtube_dl/postprocessor
parent2a2e2770cc216e3a0d29eb3d164b62bc97938176 (diff)
Move check_executable into a helper ufnction
Diffstat (limited to 'youtube_dl/postprocessor')
-rw-r--r--youtube_dl/postprocessor/ffmpeg.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py
index 91434d970..a7fe5f346 100644
--- a/youtube_dl/postprocessor/ffmpeg.py
+++ b/youtube_dl/postprocessor/ffmpeg.py
@@ -7,6 +7,7 @@ import time
from .common import AudioConversionError, PostProcessor
from ..utils import (
+ check_executable,
compat_subprocess_get_DEVNULL,
encodeFilename,
PostProcessingError,
@@ -27,14 +28,8 @@ class FFmpegPostProcessor(PostProcessor):
@staticmethod
def detect_executables():
- def executable(exe):
- try:
- subprocess.Popen([exe, '-version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
- except OSError:
- return False
- return exe
programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
- return dict((program, executable(program)) for program in programs)
+ return dict((program, check_executable(program, ['-version'])) for program in programs)
def run_ffmpeg_multiple_files(self, input_paths, out_path, opts):
if not self._exes['ffmpeg'] and not self._exes['avconv']: