diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-09-23 17:59:27 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-12-11 16:18:48 +0100 |
commit | 3bc2ddccc8622379ec11e802dff30a635285a9c8 (patch) | |
tree | 63fe2e72f439c5db7f8047f395eca030981e620b /youtube_dl/YoutubeDL.py | |
parent | 8ab470f1b26b6c42ab74ceb345994c201743bed8 (diff) |
Move FileDownloader to its own module and create a new class for each download process
A suitable downloader can be found using the 'get_suitable_downloader' function.
Each subclass implements 'real_download', for downloading an info dict you call the 'download' method, which first checks if the video has already been downloaded
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r-- | youtube_dl/YoutubeDL.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 6a34f16d5..414aa5a80 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -51,7 +51,7 @@ from .utils import ( YoutubeDLHandler, ) from .extractor import get_info_extractor, gen_extractors -from .FileDownloader import FileDownloader +from .downloader import get_suitable_downloader from .version import __version__ @@ -847,10 +847,10 @@ class YoutubeDL(object): success = True else: try: - fd = FileDownloader(self, self.params) + fd = get_suitable_downloader(info_dict)(self, self.params) for ph in self._fd_progress_hooks: fd.add_progress_hook(ph) - success = fd._do_download(filename, info_dict) + success = fd.download(filename, info_dict) except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err: self.report_error(u'unable to download video data: %s' % str(err)) return |