1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-05 02:32:44 +01:00

[downloader/hls] Use check_executable

This commit is contained in:
Jaime Marquínez Ferrándiz 2014-08-27 15:49:07 +02:00
parent 29153f49b3
commit 3c765c68c4

View File

@ -3,6 +3,7 @@
from .common import FileDownloader
from ..utils import (
check_executable,
encodeFilename,
)
@ -19,11 +20,8 @@ def real_download(self, filename, info_dict):
encodeFilename(tmpfilename, for_subprocess=True)]
for program in ['avconv', 'ffmpeg']:
try:
subprocess.call([program, '-version'], stdout=(open(os.path.devnull, 'w')), stderr=subprocess.STDOUT)
if check_executable(program, ['-version']):
break
except (OSError, IOError):
pass
else:
self.report_error(u'm3u8 download detected but ffmpeg or avconv could not be found. Please install one.')
cmd = [program] + args