mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-23 08:17:00 +00:00
[downloader/hls] Use check_executable
This commit is contained in:
parent
29153f49b3
commit
3c765c68c4
1 changed files with 2 additions and 4 deletions
|
@ -3,6 +3,7 @@ import subprocess
|
||||||
|
|
||||||
from .common import FileDownloader
|
from .common import FileDownloader
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
check_executable,
|
||||||
encodeFilename,
|
encodeFilename,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -19,11 +20,8 @@ class HlsFD(FileDownloader):
|
||||||
encodeFilename(tmpfilename, for_subprocess=True)]
|
encodeFilename(tmpfilename, for_subprocess=True)]
|
||||||
|
|
||||||
for program in ['avconv', 'ffmpeg']:
|
for program in ['avconv', 'ffmpeg']:
|
||||||
try:
|
if check_executable(program, ['-version']):
|
||||||
subprocess.call([program, '-version'], stdout=(open(os.path.devnull, 'w')), stderr=subprocess.STDOUT)
|
|
||||||
break
|
break
|
||||||
except (OSError, IOError):
|
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
self.report_error(u'm3u8 download detected but ffmpeg or avconv could not be found. Please install one.')
|
self.report_error(u'm3u8 download detected but ffmpeg or avconv could not be found. Please install one.')
|
||||||
cmd = [program] + args
|
cmd = [program] + args
|
||||||
|
|
Loading…
Reference in a new issue