From 58125cc90a78b67093b8213247ea647dd67dd9ca Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 18 Dec 2015 06:09:04 +0100 Subject: Spare code fixes --- module/plugins/hoster/Keep2ShareCc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index 560895eb9..8c5cc53cd 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -114,12 +114,13 @@ class Keep2ShareCc(SimpleHoster): m = re.search(self.CAPTCHA_PATTERN, self.data) self.log_debug("CAPTCHA_PATTERN found %s" % m) + if m is not None: captcha_url = urlparse.urljoin("http://keep2s.cc/", m.group(1)) post_data['CaptchaForm[code]'] = self.captcha.decrypt(captcha_url) else: - recaptcha = ReCaptcha(self.pyfile) - response, challenge = recaptcha.challenge() + self.captcha = ReCaptcha(self.pyfile) + response, challenge = self.captcha.challenge() post_data.update({'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) -- cgit v1.2.3