summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-12 09:56:44 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-12 09:56:44 +0200
commit7fe05500cc738eda76216510e110eb118ad04dee (patch)
tree5083b7371b1113be0eb5cbc0c4bcf00ef794e047 /module
parentuserApi for plugins (diff)
downloadpyload-7fe05500cc738eda76216510e110eb118ad04dee.tar.xz
higher low speed time, easier way to set curl options
Diffstat (limited to 'module')
-rw-r--r--module/network/HTTPRequest.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py
index 290a27a40..4b45e10a2 100644
--- a/module/network/HTTPRequest.py
+++ b/module/network/HTTPRequest.py
@@ -62,6 +62,7 @@ class HTTPRequest():
self.initHandle()
self.setInterface(options)
+ self.setOptions(options)
self.c.setopt(pycurl.WRITEFUNCTION, self.write)
self.c.setopt(pycurl.HEADERFUNCTION, self.writeHeader)
@@ -79,7 +80,8 @@ class HTTPRequest():
if hasattr(pycurl, "AUTOREFERER"):
self.c.setopt(pycurl.AUTOREFERER, 1)
self.c.setopt(pycurl.SSL_VERIFYPEER, 0)
- self.c.setopt(pycurl.LOW_SPEED_TIME, 30)
+ # Interval for low speed, detects connection loss, but can abort dl if hoster stalls the download
+ self.c.setopt(pycurl.LOW_SPEED_TIME, 45)
self.c.setopt(pycurl.LOW_SPEED_LIMIT, 5)
#self.c.setopt(pycurl.VERBOSE, 1)
@@ -127,6 +129,11 @@ class HTTPRequest():
if "timeout" in options:
self.c.setopt(pycurl.LOW_SPEED_TIME, options["timeout"])
+ def setOptions(self, options):
+ """ Sets same options as available in pycurl """
+ for k, v in options.iteritems():
+ if hasattr(pycurl, k):
+ self.c.setopt(getattr(pycurl, k), v)
def addCookies(self):
""" put cookies from curl handle to cj """