aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrkrossxdx <mrkrossxdx@libero.it>2015-04-24 20:50:34 +0200
committermrkrossxdx <mrkrossxdx@libero.it>2015-04-24 20:50:34 +0200
commitdb37e0c273d9d139d1d6a8541146d929b659610d (patch)
treec4f097d3727a2c6a438655c36e811458b0488050
parentd0aefec99aa7bf2cd307b700f7c0d2c268d6762d (diff)
Added support for mpv if mplayer is not available
-rw-r--r--youtube_dl/downloader/mplayer.py17
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.