summaryrefslogtreecommitdiffstats
path: root/module/network
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-12-02 15:37:25 +0100
committerGravatar spoob <spoob@gmx.de> 2009-12-02 15:37:25 +0100
commit9ecbb58e7ea06cb604745e25627e2fb4709fa442 (patch)
tree90f88ee74a9e7ff6feeed5834b9e3a351ebce9ca /module/network
parentFixed EOL Errors, beautified js (diff)
downloadpyload-9ecbb58e7ea06cb604745e25627e2fb4709fa442.tar.xz
New Update Function, pycurl able to just load headers, little fixes
Diffstat (limited to 'module/network')
-rwxr-xr-xmodule/network/Request.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/module/network/Request.py b/module/network/Request.py
index b80ea44da..cda8e50f1 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -110,7 +110,7 @@ class Request:
"Connection: keep-alive",
"Keep-Alive: 300"])
- def load(self, url, get={}, post={}, ref=True, cookies=False):
+ def load(self, url, get={}, post={}, ref=True, cookies=False, just_header=False):
if post:
post = urllib.urlencode(post)
@@ -136,6 +136,13 @@ class Request:
if ref and self.lastURL is not None:
self.pycurl.setopt(pycurl.REFERER, self.lastURL)
+ if just_header:
+ self.pycurl.setopt(pycurl.NOPROGRESS, 1)
+ self.pycurl.setopt(pycurl.NOBODY, 1)
+ self.pycurl.perform()
+ self.pycurl.setopt(pycurl.NOPROGRESS, 0)
+ self.pycurl.setopt(pycurl.NOBODY, 0)
+ return self.header
self.pycurl.perform()