Fix initialization of YoutubeDL with params set to None
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 31 Dec 2013 12:34:52 +0000 (13:34 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 31 Dec 2013 12:34:52 +0000 (13:34 +0100)
Set it to an empty dictionary because it’s directly accessed when setting some properties

youtube_dl/YoutubeDL.py

index a9a3639d7f7a32053990f0b41e487b837a704767..738304193f71e10eef3656dd17e3606a69bdc32f 100644 (file)
@@ -164,6 +164,8 @@ class YoutubeDL(object):
 
     def __init__(self, params=None):
         """Create a FileDownloader object with the given options."""
+        if params is None:
+            params = {}
         self._ies = []
         self._ies_instances = {}
         self._pps = []
@@ -172,7 +174,7 @@ class YoutubeDL(object):
         self._num_downloads = 0
         self._screen_file = [sys.stdout, sys.stderr][params.get('logtostderr', False)]
         self._err_file = sys.stderr
-        self.params = {} if params is None else params
+        self.params = params
 
         if params.get('bidi_workaround', False):
             try: