[common] lower proto_preference of rtsp formats
authorRemita Amine <remitamine@gmail.com>
Thu, 4 Aug 2016 08:24:20 +0000 (09:24 +0100)
committerRemita Amine <remitamine@gmail.com>
Thu, 4 Aug 2016 08:39:06 +0000 (09:39 +0100)
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

youtube_dl/extractor/common.py

index 3b6a5491dbd1f17ef0d056b385955354c82df156..2d337d614284d93779812b2f4916528627268e66 100644 (file)
@@ -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