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:
parent
9da526aae7
commit
79a1c9c918
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user