aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/downloader/__init__.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2016-02-19 19:29:24 +0100
committerremitamine <remitamine@gmail.com>2016-02-19 19:29:24 +0100
commit12b84ac8c13754baeeead907d8c9d239141f8706 (patch)
treeeb335e6c4ea5b6d1539dbc66a9c73731c54ca05f /youtube_dl/downloader/__init__.py
parent8ec64ac68354cdf9428cd58506481ef4476c47c9 (diff)
[downloader/external] Add FFmpegFD(fixes #622)
- replace HlsFD and RtspFD - add basic support for downloading part of the video or audio
Diffstat (limited to 'youtube_dl/downloader/__init__.py')
-rw-r--r--youtube_dl/downloader/__init__.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/youtube_dl/downloader/__init__.py b/youtube_dl/downloader/__init__.py
index dccc59212..bb6afb1f8 100644
--- a/youtube_dl/downloader/__init__.py
+++ b/youtube_dl/downloader/__init__.py
@@ -1,14 +1,15 @@
from __future__ import unicode_literals
from .common import FileDownloader
-from .external import get_external_downloader
from .f4m import F4mFD
from .hls import HlsFD
-from .hls import NativeHlsFD
from .http import HttpFD
-from .rtsp import RtspFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
+from .external import (
+ get_external_downloader,
+ FFmpegFD,
+)
from ..utils import (
determine_protocol,
@@ -16,10 +17,10 @@ from ..utils import (
PROTOCOL_MAP = {
'rtmp': RtmpFD,
- 'm3u8_native': NativeHlsFD,
- 'm3u8': HlsFD,
- 'mms': RtspFD,
- 'rtsp': RtspFD,
+ 'm3u8_native': HlsFD,
+ 'm3u8': FFmpegFD,
+ 'mms': FFmpegFD,
+ 'rtsp': FFmpegFD,
'f4m': F4mFD,
'http_dash_segments': DashSegmentsFD,
}
@@ -30,6 +31,9 @@ def get_suitable_downloader(info_dict, params={}):
protocol = determine_protocol(info_dict)
info_dict['protocol'] = protocol
+ if (info_dict.get('start_time') or info_dict.get('end_time')) and FFmpegFD.supports(info_dict):
+ return FFmpegFD
+
external_downloader = params.get('external_downloader')
if external_downloader is not None:
ed = get_external_downloader(external_downloader)
@@ -37,7 +41,7 @@ def get_suitable_downloader(info_dict, params={}):
return ed
if protocol == 'm3u8' and params.get('hls_prefer_native'):
- return NativeHlsFD
+ return HlsFD
return PROTOCOL_MAP.get(protocol, HttpFD)