Merge pull request #1829 from jaimeMF/ydl-empty-params
[youtube-dl] / youtube_dl / YoutubeDL.py
index 46635bce1511f4fb6da7957905d295f692e9218f..d0aab1bbd79c9d7a280df5ec63a3bb4f18d52411 100644 (file)
@@ -258,10 +258,6 @@ class YoutubeDL(object):
         if self.params.get('cookiefile') is not None:
             self.cookiejar.save()
 
-    def fixed_template(self):
-        """Checks if the output template is fixed."""
-        return (re.search(u'(?u)%\\(.+?\\)s', self.params['outtmpl']) is None)
-
     def trouble(self, message=None, tb=None):
         """Determine action to take when a download problem appears.
 
@@ -798,7 +794,9 @@ class YoutubeDL(object):
 
     def download(self, url_list):
         """Download a given list of URLs."""
-        if len(url_list) > 1 and self.fixed_template():
+        if (len(url_list) > 1 and
+                '%' not in self.params['outtmpl']
+                and self.params.get('max_downloads') != 1):
             raise SameFileError(self.params['outtmpl'])
 
         for url in url_list:
@@ -968,7 +966,7 @@ class YoutubeDL(object):
                 proxy_map.update(handler.proxies)
         write_string(u'[debug] Proxy map: ' + compat_str(proxy_map) + u'\n')
 
-    def _setup_opener(self, timeout=300):
+    def _setup_opener(self, timeout=20):
         opts_cookiefile = self.params.get('cookiefile')
         opts_proxy = self.params.get('proxy')