diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-04-12 19:23:51 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-04-12 19:23:51 +0200 |
commit | f0afbee15380bf5fc242fb3dd5439a9ea9c67d5c (patch) | |
tree | 7e82c022c157a39232fc590ab2ffa69787f5d260 /pyload/plugin/captcha/AdYouLike.py | |
parent | Cleanup (diff) | |
parent | import fixes + code-cleanup (diff) | |
download | pyload-f0afbee15380bf5fc242fb3dd5439a9ea9c67d5c.tar.xz |
Merge branch 'pr/n3_ardi69' into 0.4.10
Conflicts:
pyload/plugin/Plugin.py
pyload/webui/app/pyloadweb.py
Diffstat (limited to 'pyload/plugin/captcha/AdYouLike.py')
-rw-r--r-- | pyload/plugin/captcha/AdYouLike.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/pyload/plugin/captcha/AdYouLike.py b/pyload/plugin/captcha/AdYouLike.py index 42441ee86..83fc4e1a3 100644 --- a/pyload/plugin/captcha/AdYouLike.py +++ b/pyload/plugin/captcha/AdYouLike.py @@ -15,11 +15,9 @@ class AdYouLike(Captcha): __license = "GPLv3" __authors = [("Walter Purcaro", "vuolter@gmail.com")] - AYL_PATTERN = r'Adyoulike\.create\s*\((.+?)\)' CALLBACK_PATTERN = r'(Adyoulike\.g\._jsonp_\d+)' - def detect_key(self, html=None): if not html: if hasattr(self.plugin, "html") and self.plugin.html: @@ -39,7 +37,6 @@ class AdYouLike(Captcha): self.logDebug("Ayl or callback not found") return None - def challenge(self, key=None, html=None): if not key: if self.detect_key(html): @@ -56,8 +53,8 @@ class AdYouLike(Captcha): ayl = json_loads(ayl) html = self.plugin.req.load("http://api-ayl.appspot.com/challenge", - get={'key' : ayl['adyoulike']['key'], - 'env' : ayl['all']['env'], + get={'key': ayl['adyoulike']['key'], + 'env': ayl['all']['env'], 'callback': callback}) try: challenge = json_loads(re.search(callback + r'\s*\((.+?)\)', html).group(1)) @@ -71,7 +68,6 @@ class AdYouLike(Captcha): return self.result(ayl, challenge), challenge - def result(self, server, challenge): # Adyoulike.g._jsonp_5579316662423138 # ({"translations":{"fr":{"instructions_visual":"Recopiez « Soonnight » ci-dessous :"}}, @@ -98,11 +94,11 @@ class AdYouLike(Captcha): self.plugin.fail(errmsg) raise AttributeError(errmsg) - result = {'_ayl_captcha_engine' : "adyoulike", - '_ayl_env' : server['all']['env'], - '_ayl_tid' : challenge['tid'], + result = {'_ayl_captcha_engine': "adyoulike", + '_ayl_env': server['all']['env'], + '_ayl_tid': challenge['tid'], '_ayl_token_challenge': challenge['token'], - '_ayl_response' : response} + '_ayl_response': response} self.logDebug("Result: %s" % result) |