From dae3ed77f3a36ba81c051bc3f47bdaeabcc4f129 Mon Sep 17 00:00:00 2001 From: mkaay Date: Fri, 13 Aug 2010 13:09:21 +0200 Subject: recaptcha + new crypter lof.cc --- module/plugins/ReCaptcha.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 module/plugins/ReCaptcha.py (limited to 'module/plugins/ReCaptcha.py') diff --git a/module/plugins/ReCaptcha.py b/module/plugins/ReCaptcha.py new file mode 100644 index 000000000..23e1064ce --- /dev/null +++ b/module/plugins/ReCaptcha.py @@ -0,0 +1,19 @@ +import re + +class ReCaptcha(): + def __init__(self, plugin): + self.plugin = plugin + + def challenge(self, id): + js = self.plugin.req.load("http://api.recaptcha.net/challenge", get={"k":id}, cookies=True) + print js + challenge = re.search("challenge : '(.*?)',", js).group(1) + server = re.search("server : '(.*?)',", js).group(1) + try: + challenge = re.search("challenge : '(.*?)',", js).group(1) + server = re.search("server : '(.*?)',", js).group(1) + except: + self.plugin.fail("recaptcha error") + result = self.plugin.decryptCaptcha("%simage"%server, get={"c":challenge}, cookies=True) + + return challenge, result -- cgit v1.2.3