diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:25:14 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:25:14 +0200 |
commit | 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 (patch) | |
tree | 20d379639d14a2b69deaa9e0376e33312b5bb994 /module/plugins/internal | |
parent | [ShareRapidCom] Fix https://github.com/pyload/pyload/issues/694 (diff) | |
download | pyload-05d258d98dd8c2faf0b769840fa1e3c4acccdce8.tar.xz |
Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9
Diffstat (limited to 'module/plugins/internal')
-rw-r--r-- | module/plugins/internal/CaptchaService.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index 6586256f7..d325d7928 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -29,7 +29,7 @@ class ReCaptcha: def detect_key(self, html): m = re.search(self.RECAPTCHA_KEY_PATTERN, html) - if not m: + if m is None: m = re.search(self.RECAPTCHA_KEY_AJAX_PATTERN, html) if m: self.recaptcha_key = m.group('key') @@ -38,9 +38,9 @@ class ReCaptcha: return None def challenge(self, key=None): - if not key and self.recaptcha_key: + if key is None and self.recaptcha_key: key = self.recaptcha_key - elif not (key or self.recaptcha_key): + else: raise TypeError("ReCaptcha key not found") js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={"k": key}, cookies=True) |