diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-11 17:08:29 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-11 17:08:29 +0100 |
commit | 1de45d9f4f2a39e205dd99e0dcf8b0c323537fea (patch) | |
tree | b83d12fd13a27d798326d8a5e2fda136cab009e4 /pyload/plugins/hoster | |
parent | Bucket and CookieJar from 0.5.0 (diff) | |
download | pyload-1de45d9f4f2a39e205dd99e0dcf8b0c323537fea.tar.xz |
Spare code cosmetics
Diffstat (limited to 'pyload/plugins/hoster')
-rw-r--r-- | pyload/plugins/hoster/GigapetaCom.py | 13 | ||||
-rw-r--r-- | pyload/plugins/hoster/QuickshareCz.py | 6 | ||||
-rw-r--r-- | pyload/plugins/hoster/UnibytesCom.py | 6 |
3 files changed, 7 insertions, 18 deletions
diff --git a/pyload/plugins/hoster/GigapetaCom.py b/pyload/plugins/hoster/GigapetaCom.py index 9bcd54dbc..06d3cc6cf 100644 --- a/pyload/plugins/hoster/GigapetaCom.py +++ b/pyload/plugins/hoster/GigapetaCom.py @@ -2,7 +2,6 @@ import re -from pycurl import FOLLOWLOCATION from random import randint from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -31,16 +30,15 @@ class GigapetaCom(SimpleHoster): captcha_key = str(randint(1, 100000000)) captcha_url = "http://gigapeta.com/img/captcha.gif?x=%s" % captcha_key - self.req.http.c.setopt(FOLLOWLOCATION, 0) - for _i in xrange(5): self.checkErrors() captcha = self.decryptCaptcha(captcha_url) - self.html = self.load(self.pyfile.url, post={ - "captcha_key": captcha_key, - "captcha": captcha, - "download": "Download"}) + self.html = self.load(self.pyfile.url, + post={'captcha_key': captcha_key, + 'captcha' : captcha, + 'download' : "Download"}, + follow_location=False) m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I) if m: @@ -51,7 +49,6 @@ class GigapetaCom(SimpleHoster): else: self.fail(_("No valid captcha code entered")) - self.req.http.c.setopt(FOLLOWLOCATION, 1) self.download(download_url) diff --git a/pyload/plugins/hoster/QuickshareCz.py b/pyload/plugins/hoster/QuickshareCz.py index effbb24fb..ba0c30947 100644 --- a/pyload/plugins/hoster/QuickshareCz.py +++ b/pyload/plugins/hoster/QuickshareCz.py @@ -2,8 +2,6 @@ import re -from pycurl import FOLLOWLOCATION - from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -60,10 +58,8 @@ class QuickshareCz(SimpleHoster): data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ("ID1", "ID2", "ID3", "ID4")) self.logDebug("FREE URL1:" + download_url, data) - self.req.http.c.setopt(FOLLOWLOCATION, 0) - self.load(download_url, post=data) + self.load(download_url, post=data, follow_location=False) self.header = self.req.http.header - self.req.http.c.setopt(FOLLOWLOCATION, 1) m = re.search(r'Location\s*:\s*(.+)', self.header, re.I) if m is None: diff --git a/pyload/plugins/hoster/UnibytesCom.py b/pyload/plugins/hoster/UnibytesCom.py index 1fcd1d89d..d0d65840d 100644 --- a/pyload/plugins/hoster/UnibytesCom.py +++ b/pyload/plugins/hoster/UnibytesCom.py @@ -4,8 +4,6 @@ import re from urlparse import urljoin -from pycurl import FOLLOWLOCATION - from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -32,11 +30,10 @@ class UnibytesCom(SimpleHoster): def handleFree(self): domain = "http://www.%s/" % self.HOSTER_DOMAIN action, post_data = self.parseHtmlForm('id="startForm"') - self.req.http.c.setopt(FOLLOWLOCATION, 0) for _i in xrange(8): self.logDebug(action, post_data) - self.html = self.load(urljoin(domain, action), post=post_data) + self.html = self.load(urljoin(domain, action), post=post_data, follow_location=False) m = re.search(r'location:\s*(\S+)', self.req.http.header, re.I) if m: @@ -67,7 +64,6 @@ class UnibytesCom(SimpleHoster): else: self.fail(_("No valid captcha code entered")) - self.req.http.c.setopt(FOLLOWLOCATION, 1) self.download(url) |