diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-25 21:55:20 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-25 22:03:39 +0100 |
commit | a3927cf7eefd2318cdfb44cdb213b3810ea7627b (patch) | |
tree | 1232dfbd2fb6610d051a29ca2349d34c4d463afc /youtube_dl/YoutubeDL.py | |
parent | 1a62c18f6521803ab41483f5da56fc72957d7655 (diff) |
Allow to initialize a YoutubeDL object without parameters
Having to pass the 'outtmpl' parameter feels really strange when you just want to extract the info of a video.
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r-- | youtube_dl/YoutubeDL.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index a1ef3a94a..46635bce1 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -146,7 +146,7 @@ class YoutubeDL(object): _num_downloads = None _screen_file = None - def __init__(self, params): + def __init__(self, params={}): """Create a FileDownloader object with the given options.""" self._ies = [] self._ies_instances = {} @@ -169,7 +169,7 @@ class YoutubeDL(object): self.params = params self.fd = FileDownloader(self, self.params) - if '%(stitle)s' in self.params['outtmpl']: + if '%(stitle)s' in self.params.get('outtmpl', ''): self.report_warning(u'%(stitle)s is deprecated. Use the %(title)s and the --restrict-filenames flag(which also secures %(uploader)s et al) instead.') self._setup_opener() |