summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/BezvadataCz.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/BezvadataCz.py')
-rw-r--r--module/plugins/hoster/BezvadataCz.py28
1 files changed, 10 insertions, 18 deletions
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py
index 547be68fb..204c981c6 100644
--- a/module/plugins/hoster/BezvadataCz.py
+++ b/module/plugins/hoster/BezvadataCz.py
@@ -39,24 +39,16 @@ class BezvadataCz(SimpleHoster):
#: Captcha form
self.html = self.load(url)
self.check_errors()
- for _i in xrange(5):
- action, inputs = self.parse_html_form('frm-stahnoutFreeForm')
- if not inputs:
- self.error(_("FreeForm"))
-
- m = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html)
- if m is None:
- self.error(_("Wrong captcha image"))
-
- inputs['captcha'] = self.captcha.decrypt_image(m.group(1).decode('base64'), input_type='png')
-
- if '<img src="data:image/png;base64' in self.html:
- self.captcha.invalid()
- else:
- self.captcha.correct()
- break
- else:
- self.fail(_("No valid captcha code entered"))
+
+ action, inputs = self.parse_html_form('frm-stahnoutFreeForm')
+ if not inputs:
+ self.error(_("FreeForm"))
+
+ m = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html)
+ if m is None:
+ self.retry_captcha()
+
+ inputs['captcha'] = self.captcha.decrypt_image(m.group(1).decode('base64'), input_type='png')
#: Download url
self.html = self.load("http://bezvadata.cz%s" % action, post=inputs)