youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit 3511266bc39976a926a9f33a0762aa40212431ee
parent 9fdece5d340f24ab3c16770f71fd26943f4996c2
Author: Philipp Hagemeister <phihag@phihag.de>
Date:   Tue, 28 Oct 2014 12:54:29 +0100

[YoutubeDL] Simplify API of YoutubeDL

Calling add_default_extractors twice should be harmless since the first set of extractors will match.

Diffstat:
Myoutube_dl/YoutubeDL.py | 6+++++-
Myoutube_dl/__init__.py | 3---
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py @@ -189,7 +189,7 @@ class YoutubeDL(object): _num_downloads = None _screen_file = None - def __init__(self, params=None): + def __init__(self, params=None, auto_init=True): """Create a FileDownloader object with the given options.""" if params is None: params = {} @@ -246,6 +246,10 @@ class YoutubeDL(object): self._setup_opener() + if auto_init: + self.print_debug_header() + self.add_default_info_extractors() + def add_info_extractor(self, ie): """Add an InfoExtractor object to the end of the list.""" self._ies.append(ie) diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py @@ -293,9 +293,6 @@ def _real_main(argv=None): } with YoutubeDL(ydl_opts) as ydl: - ydl.print_debug_header() - ydl.add_default_info_extractors() - # PostProcessors # Add the metadata pp first, the other pps will copy it if opts.addmetadata: