1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-23 00:07:49 +00:00

Added support for mpv if mplayer is not available

This commit is contained in:
mrkrossxdx 2015-04-24 20:50:34 +02:00
parent d0aefec99a
commit db37e0c273

View file

@ -16,12 +16,19 @@ class MplayerFD(FileDownloader):
self.report_destination(filename) self.report_destination(filename)
tmpfilename = self.temp_name(filename) tmpfilename = self.temp_name(filename)
args = []
# Check for mplayer first
if check_executable('mplayer', ['-h']):
args = [ args = [
'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
if not check_executable('mplayer', ['-h']): # Check for mpv
self.report_error('MMS or RTSP download detected but "%s" could not be run' % args[0]) elif check_executable('mpv', ['-h']):
args = [
'mpv', '-really-quiet', '--vo=null', '--stream-dump=' + tmpfilename, url]
else:
self.report_error('MMS or RTSP download detected but neither "mplayer" nor "mpv" could be run')
return False return False
# Download using mplayer. # Download using mplayer.