diff options
| author | 2009-08-17 20:27:05 +0200 | |
|---|---|---|
| committer | 2009-08-17 20:27:05 +0200 | |
| commit | 152d81fb4a194d911a5f0ce475467eb3c9eb806c (patch) | |
| tree | 59d02d918f43ddc61bf1f1682dbbcb269e49be91 /module/network | |
| parent | identation fix (diff) | |
| download | pyload-152d81fb4a194d911a5f0ce475467eb3c9eb806c.tar.xz | |
pycurl auth fix
Diffstat (limited to 'module/network')
| -rwxr-xr-x | module/network/Request.py | 8 | 
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)  | 
