diff options
author | 2015-10-02 10:09:26 +0200 | |
---|---|---|
committer | 2015-10-02 10:09:26 +0200 | |
commit | 3a08656c5665f4b8db98744fb323e64b8630e084 (patch) | |
tree | 28f9f62ffc57888b76ca32540dbf5af3a4cfc8d0 /module/plugins/captcha | |
parent | Merge pull request #1 from pyload/stable (diff) | |
parent | [Account] Improve parse_traffic method + code cosmetics (diff) | |
download | pyload-3a08656c5665f4b8db98744fb323e64b8630e084.tar.xz |
Merge pull request #2 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/captcha')
-rw-r--r-- | module/plugins/captcha/AdYouLike.py | 4 | ||||
-rw-r--r-- | module/plugins/captcha/LinksaveIn.py | 2 | ||||
-rw-r--r-- | module/plugins/captcha/ReCaptcha.py | 2 | ||||
-rw-r--r-- | module/plugins/captcha/SolveMedia.py | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/module/plugins/captcha/AdYouLike.py b/module/plugins/captcha/AdYouLike.py index f91b5805c..cac73774a 100644 --- a/module/plugins/captcha/AdYouLike.py +++ b/module/plugins/captcha/AdYouLike.py @@ -76,7 +76,7 @@ class AdYouLike(CaptchaService): try: instructions_visual = challenge['translations'][server['all']['lang']]['instructions_visual'] - result = re.search(u'«(.+?)»', instructions_visual).group(1).strip() + response = re.search(u'«(.+?)»', instructions_visual).group(1).strip() except AttributeError: self.fail(_("AdYouLike result not found")) @@ -87,6 +87,6 @@ class AdYouLike(CaptchaService): '_ayl_token_challenge': challenge['token'], '_ayl_response' : response} - self.log_debug("Result: %s" % result) + self.log_debug("Result: %s" % response) return result diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index 4d2e2bc34..a9ccecf3c 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -79,8 +79,10 @@ class LinksaveIn(OCR): rgb_c = lut[pix[x, y]] try: cstat[rgb_c] += 1 + except Exception: cstat[rgb_c] = 1 + if rgb_bg is rgb_c: stat[bgpath] += 1 max_p = 0 diff --git a/module/plugins/captcha/ReCaptcha.py b/module/plugins/captcha/ReCaptcha.py index 5931159c5..a3ac52cb1 100644 --- a/module/plugins/captcha/ReCaptcha.py +++ b/module/plugins/captcha/ReCaptcha.py @@ -31,7 +31,7 @@ class ReCaptcha(CaptchaService): html = data or self.retrieve_data() m = re.search(self.KEY_V2_PATTERN, html) or re.search(self.KEY_V1_PATTERN, html) - if m: + if m is not None: self.key = m.group(1).strip() self.log_debug("Key: %s" % self.key) return self.key diff --git a/module/plugins/captcha/SolveMedia.py b/module/plugins/captcha/SolveMedia.py index 870b5fc10..a5a49b68e 100644 --- a/module/plugins/captcha/SolveMedia.py +++ b/module/plugins/captcha/SolveMedia.py @@ -24,7 +24,7 @@ class SolveMedia(CaptchaService): html = data or self.retrieve_data() m = re.search(self.KEY_PATTERN, html) - if m: + if m is not None: self.key = m.group(1).strip() self.log_debug("Key: %s" % self.key) return self.key |