Make socket timeout configurable, and bump default to 10 minutes (#1862)
authorPhilipp Hagemeister <phihag@phihag.de>
Sun, 1 Dec 2013 10:42:02 +0000 (11:42 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Sun, 1 Dec 2013 10:42:02 +0000 (11:42 +0100)
test/parameters.json
youtube_dl/YoutubeDL.py

index f042880edbf0bcab661900b86809ade8ec7697af..487a46d56670c1ded91cd71ed35055e54232187b 100644 (file)
@@ -39,5 +39,6 @@
     "writeinfojson": true, 
     "writesubtitles": false,
     "allsubtitles": false,
-    "listssubtitles": false
+    "listssubtitles": false,
+    "socket_timeout": 20
 }
index b822930cbe358226c70b514287509d391adc116c..b7393fd7983327c0df3d95f931d843967ca0a57e 100644 (file)
@@ -132,6 +132,7 @@ class YoutubeDL(object):
     cookiefile:        File name where cookies should be read from and dumped to.
     nocheckcertificate:Do not verify SSL certificates
     proxy:             URL of the proxy server to use
+    socket_timeout:    Time to wait for unresponsive hosts, in seconds
 
     The following parameters are not used by YoutubeDL itself, they are used by
     the FileDownloader:
@@ -969,7 +970,8 @@ 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=20):
+    def _setup_opener(self):
+        timeout = float(self.params.get('socket_timeout', 600))
         opts_cookiefile = self.params.get('cookiefile')
         opts_proxy = self.params.get('proxy')