mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[downloader/mplayer] Use check_executable
This commit is contained in:
		| @@ -6,6 +6,7 @@ import subprocess | |||||||
| from .common import FileDownloader | from .common import FileDownloader | ||||||
| from ..compat import compat_subprocess_get_DEVNULL | from ..compat import compat_subprocess_get_DEVNULL | ||||||
| from ..utils import ( | from ..utils import ( | ||||||
|  |     check_executable, | ||||||
|     encodeFilename, |     encodeFilename, | ||||||
| ) | ) | ||||||
|  |  | ||||||
| @@ -20,11 +21,7 @@ class MplayerFD(FileDownloader): | |||||||
|             'mplayer', '-really-quiet', '-vo', 'null', '-vc', 'dummy', |             'mplayer', '-really-quiet', '-vo', 'null', '-vc', 'dummy', | ||||||
|             '-dumpstream', '-dumpfile', tmpfilename, url] |             '-dumpstream', '-dumpfile', tmpfilename, url] | ||||||
|         # Check for mplayer first |         # Check for mplayer first | ||||||
|         try: |         if not check_executable('mplayer', ['-h']): | ||||||
|             subprocess.call( |  | ||||||
|                 ['mplayer', '-h'], |  | ||||||
|                 stdout=compat_subprocess_get_DEVNULL(), stderr=subprocess.STDOUT) |  | ||||||
|         except (OSError, IOError): |  | ||||||
|             self.report_error('MMS or RTSP download detected but "%s" could not be run' % args[0]) |             self.report_error('MMS or RTSP download detected but "%s" could not be run' % args[0]) | ||||||
|             return False |             return False | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jaime Marquínez Ferrándiz
					Jaime Marquínez Ferrándiz