diff options
author | spoob <spoob@gmx.de> | 2009-05-31 18:23:42 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-05-31 18:23:42 +0200 |
commit | 49d41f96c4ab61850ff5fab1f21f95886975ff95 (patch) | |
tree | 4ad19319ab212c8471386aee54a2205791e45b3b /module/network | |
parent | pyload server starts when gui starts (diff) | |
download | pyload-49d41f96c4ab61850ff5fab1f21f95886975ff95.tar.xz |
download plugin for xup.in added, download works with post data
Diffstat (limited to 'module/network')
-rwxr-xr-x | module/network/Request.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/module/network/Request.py b/module/network/Request.py index 86449a4f2..25eccab87 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -51,7 +51,6 @@ class Request: ("Accept-Encoding","gzip,deflate"), ("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"), ("Accept-Charset","ISO-8859-1,utf-8;q=0.7,*;q=0.7")] - def load(self, url, get = {}, post = {}, ref = True): @@ -90,11 +89,17 @@ class Request: #def download(url, filename, reporthook = None, data = None): #default von urlretrieve auch None? # return self.downloader.urlretrieve(url, filename, reporthook, data) - def download(self, url, filename): + def download(self, url, filename, post = {}): + + if post: + post = urllib.urlencode(post) + else: + post = None + if not self.dl: self.dl = True file = open(filename, 'wb') - req = urllib2.Request(url) + req = urllib2.Request(url, post) conn = self.downloader.open(req) self.dl_size = int(conn.headers["content-length"]) self.dl_arrived = 0 |