mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-10 16:02:53 +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={}):
|
def get_suitable_downloader(info_dict, params={}):
|
||||||
"""Get the downloader class that can handle the info dict."""
|
"""Get the downloader class that can handle the info dict."""
|
||||||
protocol = determine_protocol(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
|
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):
|
# 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):
|
if ed.can_download(info_dict):
|
||||||
return ed
|
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)
|
return PROTOCOL_MAP.get(protocol, HttpFD)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user