summaryrefslogtreecommitdiffstats
path: root/module/network
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-05-31 19:43:53 +0200
committerGravatar spoob <spoob@gmx.de> 2009-05-31 19:43:53 +0200
commitc3db22d7f10340d267bb06dadd6133841388e8de (patch)
treeb578936699e082f8f884de9bec3c5d5c2bc30957 /module/network
parentBacked out changeset 9455bf89f55f made by spoob. (diff)
downloadpyload-c3db22d7f10340d267bb06dadd6133841388e8de.tar.xz
xupi.in works again
Diffstat (limited to 'module/network')
-rwxr-xr-xmodule/network/Request.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/module/network/Request.py b/module/network/Request.py
index 86449a4f2..196e350c9 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -90,11 +90,18 @@ 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