diff options
author | Sergey M. <dstftw@gmail.com> | 2015-04-25 23:19:59 +0500 |
---|---|---|
committer | Sergey M. <dstftw@gmail.com> | 2015-04-25 23:19:59 +0500 |
commit | b19fc36c813c7a78f15b2df23118962789225852 (patch) | |
tree | 4b39c45187aa4800fed9aafbc905d0fa37566a7d /youtube_dl/downloader | |
parent | d2d8248f68c029472bb81eacf4aa15987729977f (diff) | |
parent | db37e0c273d9d139d1d6a8541146d929b659610d (diff) |
Merge pull request #5521 from mrkrossxdx/mpv
Added support for mpv if mplayer is not available (new version)
Diffstat (limited to 'youtube_dl/downloader')
-rw-r--r-- | youtube_dl/downloader/mplayer.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/youtube_dl/downloader/mplayer.py b/youtube_dl/downloader/mplayer.py index 72cef30ea..551c4ae94 100644 --- a/youtube_dl/downloader/mplayer.py +++ b/youtube_dl/downloader/mplayer.py @@ -16,12 +16,19 @@ class MplayerFD(FileDownloader): self.report_destination(filename) tmpfilename = self.temp_name(filename) - args = [ - 'mplayer', '-really-quiet', '-vo', 'null', '-vc', 'dummy', - '-dumpstream', '-dumpfile', tmpfilename, url] + args = [] # Check for mplayer first - if not check_executable('mplayer', ['-h']): - self.report_error('MMS or RTSP download detected but "%s" could not be run' % args[0]) + if check_executable('mplayer', ['-h']): + args = [ + 'mplayer', '-really-quiet', '-vo', 'null', '-vc', 'dummy', + '-dumpstream', '-dumpfile', tmpfilename, url] + + # Check for mpv + 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 # Download using mplayer. |