A feature-rich command-line audio/video downloader
[YoutubeDL] Simplify API of YoutubeDL
Philipp Hagemeister3511266bc399
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.pyindex 28dcc0195b..fd775b9fd1 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)diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.pyindex 7dc971884c..3c968082c3 100644--- 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 itif opts.addmetadata: