A feature-rich command-line audio/video downloader
[downloader/mplayer] Use check_executable
Jaime Marquínez Ferrándizd26b1317edd3
diff --git a/youtube_dl/downloader/mplayer.py b/youtube_dl/downloader/mplayer.pyindex c53195da0c..34b23b5c29 100644--- a/youtube_dl/downloader/mplayer.py+++ b/youtube_dl/downloader/mplayer.py@@ -6,6 +6,7 @@ import subprocessfrom .common import FileDownloaderfrom ..compat import compat_subprocess_get_DEVNULLfrom ..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