mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 18:20:19 -05:00
Merge pull request #5521 from mrkrossxdx/mpv
Added support for mpv if mplayer is not available (new version)
This commit is contained in:
commit
b19fc36c81
1 changed files with 12 additions and 5 deletions
|
@ -16,12 +16,19 @@ def real_download(self, filename, info_dict):
|
||||||
self.report_destination(filename)
|
self.report_destination(filename)
|
||||||
tmpfilename = self.temp_name(filename)
|
tmpfilename = self.temp_name(filename)
|
||||||
|
|
||||||
args = [
|
args = []
|
||||||
'mplayer', '-really-quiet', '-vo', 'null', '-vc', 'dummy',
|
|
||||||
'-dumpstream', '-dumpfile', tmpfilename, url]
|
|
||||||
# Check for mplayer first
|
# Check for mplayer first
|
||||||
if not check_executable('mplayer', ['-h']):
|
if check_executable('mplayer', ['-h']):
|
||||||
self.report_error('MMS or RTSP download detected but "%s" could not be run' % args[0])
|
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
|
return False
|
||||||
|
|
||||||
# Download using mplayer.
|
# Download using mplayer.
|
||||||
|
|
Loading…
Reference in a new issue