summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/GigapetaCom.py
diff options
context:
space:
mode:
authorGravatar jansohn <jansohn@users.noreply.github.com> 2015-10-02 10:09:26 +0200
committerGravatar jansohn <jansohn@users.noreply.github.com> 2015-10-02 10:09:26 +0200
commit3a08656c5665f4b8db98744fb323e64b8630e084 (patch)
tree28f9f62ffc57888b76ca32540dbf5af3a4cfc8d0 /module/plugins/hoster/GigapetaCom.py
parentMerge pull request #1 from pyload/stable (diff)
parent[Account] Improve parse_traffic method + code cosmetics (diff)
downloadpyload-3a08656c5665f4b8db98744fb323e64b8630e084.tar.xz
Merge pull request #2 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/hoster/GigapetaCom.py')
-rw-r--r--module/plugins/hoster/GigapetaCom.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py
index 381c39a21..85e5e4843 100644
--- a/module/plugins/hoster/GigapetaCom.py
+++ b/module/plugins/hoster/GigapetaCom.py
@@ -36,23 +36,22 @@ class GigapetaCom(SimpleHoster):
self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
- for _i in xrange(5):
- self.check_errors()
-
- captcha = self.captcha.decrypt(captcha_url)
- self.html = self.load(pyfile.url, post={
- 'captcha_key': captcha_key,
- 'captcha': captcha,
- 'download': "Download"})
-
- m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I)
- if m:
- self.link = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10
- break
- elif "Entered figures don&#96;t coincide with the picture" in self.html:
- self.captcha.invalid()
- else:
- self.fail(_("No valid captcha code entered"))
+ self.check_errors()
+
+ captcha = self.captcha.decrypt(captcha_url)
+ self.html = self.load(pyfile.url, post={
+ 'captcha_key': captcha_key,
+ 'captcha': captcha,
+ 'download': "Download"})
+
+ m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I)
+ if m is not None:
+ self.captcha.correct()
+ self.link = m.group(1)
+
+ elif "Entered figures don&#96;t coincide with the picture" in self.html:
+ self.retry_captcha()
+
self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)