From 3511266bc39976a926a9f33a0762aa40212431ee Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Tue, 28 Oct 2014 12:54:29 +0100 Subject: [YoutubeDL] Simplify API of YoutubeDL Calling add_default_extractors twice should be harmless since the first set of extractors will match. --- youtube_dl/YoutubeDL.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'youtube_dl/YoutubeDL.py') diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 28dcc0195..fd775b9fd 100755 --- 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) -- cgit v1.2.3