Skip to content

A feature-rich command-line audio/video downloader

[common] lower proto_preference of rtsp formats

Remita Amine8b40854529ee
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 3b6a5491db..2d337d6142 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