diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2015-01-03 00:33:36 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2015-01-03 00:33:36 +0100 |
commit | d26b1317edd31d85f8fa68d796f185f7ba65c282 (patch) | |
tree | 6d75739d37fb618eea71d7dba351fbecd3a86ca8 /youtube_dl/downloader/mplayer.py | |
parent | a221f22969843866ad85fd5cdf98160c79d99e9f (diff) |
[downloader/mplayer] Use check_executable
Diffstat (limited to 'youtube_dl/downloader/mplayer.py')
-rw-r--r-- | youtube_dl/downloader/mplayer.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/youtube_dl/downloader/mplayer.py b/youtube_dl/downloader/mplayer.py index c53195da0..34b23b5c2 100644 --- a/youtube_dl/downloader/mplayer.py +++ b/youtube_dl/downloader/mplayer.py @@ -6,6 +6,7 @@ import subprocess from .common import FileDownloader from ..compat import compat_subprocess_get_DEVNULL from ..utils import ( + check_executable, encodeFilename, ) @@ -20,11 +21,7 @@ class MplayerFD(FileDownloader): 'mplayer', '-really-quiet', '-vo', 'null', '-vc', 'dummy', '-dumpstream', '-dumpfile', tmpfilename, url] # Check for mplayer first - try: - subprocess.call( - ['mplayer', '-h'], - stdout=compat_subprocess_get_DEVNULL(), stderr=subprocess.STDOUT) - except (OSError, IOError): + if not check_executable('mplayer', ['-h']): self.report_error('MMS or RTSP download detected but "%s" could not be run' % args[0]) return False |