1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-09 22:58:00 +08:00

[Downloader] --hls-prefer-ffmpeg fix

This commit is contained in:
Maxime-J 2016-05-04 20:54:53 +02:00
parent 9da526aae7
commit 79a1c9c918

View File

@ -30,6 +30,10 @@ PROTOCOL_MAP = {
def get_suitable_downloader(info_dict, params={}):
"""Get the downloader class that can handle the info dict."""
protocol = determine_protocol(info_dict)
if protocol == 'm3u8' and params.get('hls_prefer_native') is True:
protocol = 'm3u8_native'
elif protocol == 'm3u8_native' and params.get('hls_prefer_native') is False:
protocol = 'm3u8'
info_dict['protocol'] = protocol
# if (info_dict.get('start_time') or info_dict.get('end_time')) and not info_dict.get('requested_formats') and FFmpegFD.can_download(info_dict):
@ -41,12 +45,6 @@ def get_suitable_downloader(info_dict, params={}):
if ed.can_download(info_dict):
return ed
if protocol == 'm3u8' and params.get('hls_prefer_native') is True:
return HlsFD
if protocol == 'm3u8_native' and params.get('hls_prefer_native') is False:
return FFmpegFD
return PROTOCOL_MAP.get(protocol, HttpFD)