diff options
Diffstat (limited to 'module')
| -rw-r--r-- | module/plugins/captcha/AdYouLike.py | 10 | ||||
| -rw-r--r-- | module/plugins/captcha/CircleCaptcha.py | 20 | 
2 files changed, 15 insertions, 15 deletions
| diff --git a/module/plugins/captcha/AdYouLike.py b/module/plugins/captcha/AdYouLike.py index b10d2c399..8c5ec8d2a 100644 --- a/module/plugins/captcha/AdYouLike.py +++ b/module/plugins/captcha/AdYouLike.py @@ -2,7 +2,7 @@  import re -from module.common.json_layer import json_loads +from module.plugins.internal.utils import json  from module.plugins.internal.CaptchaService import CaptchaService @@ -40,14 +40,14 @@ class AdYouLike(CaptchaService):          #: {'adyoulike':{'key':"P~zQ~O0zV0WTiAzC-iw0navWQpCLoYEP"},          #: 'all':{'element_id':"ayl_private_cap_92300",'lang':"fr",'env':"prod"}} -        ayl = json_loads(ayl) +        ayl = json.loads(ayl)          html = self.plugin.load("http://api-ayl.appspot.com/challenge",                                      get={'key'     : ayl['adyoulike']['key'],                                           'env'     : ayl['all']['env'],                                           'callback': callback})          try: -            challenge = json_loads(re.search(callback + r'\s*\((.+?)\)', html).group(1)) +            challenge = json.loads(re.search(callback + r'\s*\((.+?)\)', html).group(1))          except AttributeError:              self.fail(_("AdYouLike challenge pattern not found")) @@ -69,10 +69,10 @@ class AdYouLike(CaptchaService):          #: 'tid':"SqwuAdxT1EZoi4B5q0T63LN2AkiCJBg5"})          if isinstance(server, basestring): -            server = json_loads(server) +            server = json.loads(server)          if isinstance(challenge, basestring): -            challenge = json_loads(challenge) +            challenge = json.loads(challenge)          try:              instructions_visual = challenge['translations'][server['all']['lang']]['instructions_visual'] diff --git a/module/plugins/captcha/CircleCaptcha.py b/module/plugins/captcha/CircleCaptcha.py index dc04a04c8..72d294caf 100644 --- a/module/plugins/captcha/CircleCaptcha.py +++ b/module/plugins/captcha/CircleCaptcha.py @@ -474,15 +474,15 @@ class CircleCaptcha(OCR):          #: Assial Simmetric          if self.pyload.debug: -            self.log_debug("Center: " + str(c), -                           "Missing: " + str(missing), -                           "Howmany: " + str(howmany), -                           "Ratio: " + str(missing / howmany), -                           "Missing consecutives: " + str(missingconsecutive), -                           "Missing X lenght: " + str(minX) + ":" + str(maxX), -                           "Missing Y lenght: " + str(minY) + ":" + str(maxY), -                           "Ratio without consecutives: " + str((missing - missingconsecutive) / howmany), -                           "List missing: " + str(missinglist)) +            self.log_debug("Center: %s"                     % c, +                           "Missing: %s"                    % missing, +                           "Howmany: %s"                    % howmany, +                           "Ratio: %s"                      % (missing / howmany), +                           "Missing consecutives: %s"       % missingconsecutive, +                           "Missing X lenght: %s:%s"        % (minX, maxX), +                           "Missing Y lenght: %s:%s"        % (minY, maxY), +                           "Ratio without consecutives: %s" % ((missing - missingconsecutive) / howmany), +                           "List missing: %s"               % missinglist)          #: Lenght of missing cannot be over 75% of diameter @@ -711,7 +711,7 @@ class CircleCaptcha(OCR):                              break              if self.pyload.debug: -                self.log_debug('Howmany opened circle? ' + str(len(found)) + ' ' + str(found)) +                self.log_debug("Howmany opened circle?", found)              #: Clean results              for c in found: | 
