From 2b14c07bfe427f40288b2c73db1813c0dc11659a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 23 Nov 2014 23:18:39 +0100 Subject: [CaptchaService] More debug logging --- module/plugins/internal/CaptchaService.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index 38775f519..7009e6986 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -7,7 +7,7 @@ from random import random class CaptchaService: __name__ = "CaptchaService" - __version__ = "0.14" + __version__ = "0.15" __description__ = """Base captcha service plugin""" __license__ = "GPLv3" @@ -52,7 +52,7 @@ class CaptchaService: class ReCaptcha(CaptchaService): __name__ = "ReCaptcha" - __version__ = "0.07" + __version__ = "0.08" __description__ = """ReCaptcha captcha service plugin""" __license__ = "GPLv3" @@ -92,7 +92,6 @@ class ReCaptcha(CaptchaService): raise TypeError(errmsg) js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={'k': key}) - try: challenge = re.search("challenge : '(.+?)',", js).group(1) server = re.search("server : '(.+?)',", js).group(1) @@ -101,6 +100,8 @@ class ReCaptcha(CaptchaService): result = self.result(server, challenge) + self.plugin.logDebug("ReCaptcha result: %s" % result, "challenge: %s" % challenge) + return challenge, result @@ -111,7 +112,7 @@ class ReCaptcha(CaptchaService): class AdsCaptcha(CaptchaService): __name__ = "AdsCaptcha" - __version__ = "0.04" + __version__ = "0.05" __description__ = """AdsCaptcha captcha service plugin""" __license__ = "GPLv3" @@ -154,7 +155,6 @@ class AdsCaptcha(CaptchaService): CaptchaId, PublicKey = key js = self.plugin.req.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, 'PublicKey': PublicKey}) - try: challenge = re.search("challenge: '(.+?)',", js).group(1) server = re.search("server: '(.+?)',", js).group(1) @@ -163,6 +163,8 @@ class AdsCaptcha(CaptchaService): result = self.result(server, challenge) + self.plugin.logDebug("AdsCaptcha result: %s" % result, "challenge: %s" % challenge) + return challenge, result @@ -173,7 +175,7 @@ class AdsCaptcha(CaptchaService): class SolveMedia(CaptchaService): __name__ = "SolveMedia" - __version__ = "0.05" + __version__ = "0.06" __description__ = """SolveMedia captcha service plugin""" __license__ = "GPLv3" @@ -202,6 +204,8 @@ class SolveMedia(CaptchaService): result = self.result(server, challenge) + self.plugin.logDebug("SolveMedia result: %s" % result, "challenge: %s" % challenge) + return challenge, result -- cgit v1.2.3