aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-08-04 09:24:20 +0100
committerRemita Amine <remitamine@gmail.com>2016-08-04 09:39:06 +0100
commit8b40854529eea6b32f41df448c475b87a42038d1 (patch)
tree3e90ffcc4cb193f4b1cf580cc41a94a15b34c3db
parent6bb0fbf9fb60047087b44c6e147ed071fe0dc41f (diff)
downloadyoutube-dl-8b40854529eea6b32f41df448c475b87a42038d1.tar.xz
[common] lower proto_preference of rtsp formats
Most of the time the RtspFD fail to download videos but it report success of the download with this output: [mpv] 0 bytes [download] 100% of 0.00B
-rw-r--r--youtube_dl/extractor/common.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 3b6a5491d..2d337d614 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -916,7 +916,8 @@ class InfoExtractor(object):
if f.get('ext') in ['f4f', 'f4m']: # Not yet supported
preference -= 0.5
- proto_preference = 0 if determine_protocol(f) in ['http', 'https'] else -0.1
+ protocol = f.get('protocol') or determine_protocol(f)
+ proto_preference = 0 if protocol in ['http', 'https'] else (-0.5 if protocol == 'rtsp' else -0.1)
if f.get('vcodec') == 'none': # audio only
preference -= 50