]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/downloader/__init__.py
817591d97e88606b966b7055026f691faab840dc
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import FileDownloader
 
   6 from .http 
import HttpFD
 
   7 from .rtmp 
import RtmpFD
 
   8 from .dash 
import DashSegmentsFD
 
   9 from .rtsp 
import RtspFD
 
  10 from .external 
import ( 
  11     get_external_downloader
, 
  26     'http_dash_segments': DashSegmentsFD
, 
  30 def get_suitable_downloader(info_dict
, params
={}): 
  31     """Get the downloader class that can handle the info dict.""" 
  32     protocol 
= determine_protocol(info_dict
) 
  33     info_dict
['protocol'] = protocol
 
  35     # 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): 
  38     external_downloader 
= params
.get('external_downloader') 
  39     if external_downloader 
is not None: 
  40         ed 
= get_external_downloader(external_downloader
) 
  41         if ed
.can_download(info_dict
): 
  44     if protocol 
== 'm3u8' and params
.get('hls_prefer_native') is True: 
  47     if protocol 
== 'm3u8_native' and params
.get('hls_prefer_native') is False: 
  50     return PROTOCOL_MAP
.get(protocol
, HttpFD
) 
  54     'get_suitable_downloader',