diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-21 22:53:37 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-21 22:53:37 +0200 |
commit | 027cb529d79558de19c47da88a782b31745a65c9 (patch) | |
tree | 18ab9a8568cee2d07e6fc0dc8f9c03202245c594 /module/plugins/internal/AdsCaptcha.py | |
parent | New __status__ magic key (diff) | |
download | pyload-027cb529d79558de19c47da88a782b31745a65c9.tar.xz |
New Captcha skeleton
Diffstat (limited to 'module/plugins/internal/AdsCaptcha.py')
-rw-r--r-- | module/plugins/internal/AdsCaptcha.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/internal/AdsCaptcha.py b/module/plugins/internal/AdsCaptcha.py index b99697a84..f487042e2 100644 --- a/module/plugins/internal/AdsCaptcha.py +++ b/module/plugins/internal/AdsCaptcha.py @@ -3,10 +3,10 @@ import random import re -from module.plugins.internal.Captcha import Captcha +from module.plugins.internal.CaptchaService import CaptchaService -class AdsCaptcha(Captcha): +class AdsCaptcha(CaptchaService): __name__ = "AdsCaptcha" __type__ = "captcha" __version__ = "0.10" @@ -21,8 +21,8 @@ class AdsCaptcha(Captcha): PUBLICKEY_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?.*?PublicKey=([\w-]+)' - def detect_key(self, html=None): - html = html or self.retrieve_html() + def detect_key(self, data=None): + html = data or self.retrieve_data() m = re.search(self.PUBLICKEY_PATTERN, html) n = re.search(self.CAPTCHAID_PATTERN, html) @@ -35,8 +35,8 @@ class AdsCaptcha(Captcha): return None - def challenge(self, key=None, html=None): - PublicKey, CaptchaId = key or self.retrieve_key(html) + def challenge(self, key=None, data=None): + PublicKey, CaptchaId = key or self.retrieve_key(data) html = self.plugin.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, @@ -54,10 +54,10 @@ class AdsCaptcha(Captcha): def result(self, server, challenge): - result = self.plugin.decryptCaptcha("%sChallenge.aspx" % server, - get={'cid': challenge, 'dummy': random.random()}, - cookies=True, - imgtype="jpg") + result = self.decrypt_image("%sChallenge.aspx" % server, + get={'cid': challenge, 'dummy': random.random()}, + cookies=True, + input_type="jpg") self.log_debug("Result: %s" % result) |