]> jfr.im git - yt-dlp.git/blame_incremental - youtube_dl/downloader/__init__.py
renamed for consistency
[yt-dlp.git] / youtube_dl / downloader / __init__.py
... / ...
CommitLineData
1from __future__ import unicode_literals
2
3from .common import FileDownloader
4from .hls import HlsFD
5from .http import HttpFD
6from .mplayer import MplayerFD
7from .rtmp import RtmpFD
8from .f4m import F4mFD
9
10from ..utils import (
11 determine_ext,
12)
13
14
15def get_suitable_downloader(info_dict):
16 """Get the downloader class that can handle the info dict."""
17 url = info_dict['url']
18 protocol = info_dict.get('protocol')
19
20 if url.startswith('rtmp'):
21 return RtmpFD
22 if (protocol == 'm3u8') or (protocol is None and determine_ext(url) == 'm3u8'):
23 return HlsFD
24 if url.startswith('mms') or url.startswith('rtsp'):
25 return MplayerFD
26 if determine_ext(url) == 'f4m':
27 return F4mFD
28 else:
29 return HttpFD