summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-11-13 17:05:28 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-11-13 17:05:28 +0100
commitae55e11c1f0f5b1e9378b06cccc78f0e7bae5b97 (patch)
tree5e109cd77d8a351f97774f6d7f3938f3f48708b6
parentfix Depositfiles, UlozTo (diff)
downloadpyload-ae55e11c1f0f5b1e9378b06cccc78f0e7bae5b97.tar.xz
rehost,to timeout fix
-rw-r--r--module/network/Browser.py7
-rw-r--r--module/network/HTTPRequest.py4
-rw-r--r--module/plugins/hooks/UpdateManager.py6
-rw-r--r--module/plugins/hoster/RehostTo.py2
4 files changed, 16 insertions, 3 deletions
diff --git a/module/network/Browser.py b/module/network/Browser.py
index 23cf7666b..d68a23687 100644
--- a/module/network/Browser.py
+++ b/module/network/Browser.py
@@ -112,6 +112,13 @@ class Browser(object):
if "auth" in self.options: del self.options["auth"]
self.renewHTTPRequest()
+ def setOption(self, name, value):
+ """Adds an option to the request, see HTTPRequest for existing ones"""
+ self.options[name] = value
+
+ def deleteOption(self, name):
+ if name in self.options: del self.options[name]
+
def clearHeaders(self):
self.http.clearHeaders()
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py
index 6672a58e6..bd8cdd72e 100644
--- a/module/network/HTTPRequest.py
+++ b/module/network/HTTPRequest.py
@@ -118,6 +118,10 @@ class HTTPRequest():
if "auth" in options:
self.c.setopt(pycurl.USERPWD, str(options["auth"]))
+ if "timeout" in options:
+ self.c.setopt(pycurl.LOW_SPEED_TIME, options["timeout"])
+
+
def addCookies(self):
""" put cookies from curl handle to cj """
if self.cj:
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index 705ed8eca..2a85e505f 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -121,13 +121,13 @@ class UpdateManager(Hook):
try:
content = getURL("http://get.pyload.org/plugins/get/" + path)
- except:
- self.logWarning(_("Error when updating %s") % name)
+ except Exception, e:
+ self.logWarning(_("Error when updating %s") % name, str(e))
continue
m = vre.search(content)
if not m or m.group(2) != version:
- self.logWarning(_("Error when updating %s") % name)
+ self.logWarning(_("Error when updating %s") % name, _("Version mismatch"))
continue
f = open(join("userplugins", prefix, name), "wb")
diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py
index 2531d7dbe..370adf077 100644
--- a/module/plugins/hoster/RehostTo.py
+++ b/module/plugins/hoster/RehostTo.py
@@ -32,5 +32,7 @@ class RehostTo(Hoster):
self.log.debug("Rehost.to: Old URL: %s" % pyfile.url)
new_url = "http://rehost.to/process_download.php?user=cookie&pass=%s&dl=%s" % (long_ses, quote(pyfile.url, ""))
+ #raise timeout to 2min
+ self.req.setOption("timeout", 120)
self.download(new_url, disposition=True) \ No newline at end of file