summaryrefslogtreecommitdiffstats
path: root/module/network/Request.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-17 20:27:05 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-17 20:27:05 +0200
commit152d81fb4a194d911a5f0ce475467eb3c9eb806c (patch)
tree59d02d918f43ddc61bf1f1682dbbcb269e49be91 /module/network/Request.py
parentidentation fix (diff)
downloadpyload-152d81fb4a194d911a5f0ce475467eb3c9eb806c.tar.xz
pycurl auth fix
Diffstat (limited to 'module/network/Request.py')
-rwxr-xr-xmodule/network/Request.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/network/Request.py b/module/network/Request.py
index 11c8fae89..ea17e04e8 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -45,6 +45,7 @@ class Request:
self.abort = False
self.lastURL = None
+ self.auth = False
try:
if pycurl: self.curl = True
@@ -162,6 +163,10 @@ class Request:
return output
def add_auth(self, user, pw):
+
+ self.auth = True
+ self.user = user
+ self.pw = pw
if self.curl:
self.pycurl.setopt(pycurl.USERPWD, user + ":" + pw)
@@ -219,6 +224,9 @@ class Request:
if post: self.pycurl.setopt(pycurl.POSTFIELDS, post)
+ if self.auth:
+ self.add_auth()
+
if ref and self.lastURL is not None:
self.pycurl.setopt(pycurl.REFERER, self.lastURL)