diff options
Diffstat (limited to 'module/plugins/hoster/CrockoCom.py')
-rw-r--r-- | module/plugins/hoster/CrockoCom.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 2ed140b9c..70f2be6fb 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -39,7 +39,7 @@ class CrockoCom(SimpleHoster): for _i in xrange(5): m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: + if m is not None: url = urlparse.urljoin("http://crocko.com/", m.group(1)) self.wait(m.group(2)) self.html = self.load(url) @@ -54,16 +54,11 @@ class CrockoCom(SimpleHoster): inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) recaptcha = ReCaptcha(self) - for _i in xrange(5): - inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = recaptcha.challenge() - self.download(action, post=inputs) + inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = recaptcha.challenge() + self.download(action, post=inputs) - if self.check_file({'captcha': recaptcha.KEY_AJAX_PATTERN}): - self.captcha.invalid() - else: - break - else: - self.fail(_("No valid captcha solution received")) + if self.check_file({'captcha': recaptcha.KEY_AJAX_PATTERN}): + self.retry_captcha() getInfo = create_getInfo(CrockoCom) |