diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-25 18:22:27 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-25 18:22:27 +0200 |
commit | 29f9dc8fb3396b03d732ebcbeb1cc8f00fe13897 (patch) | |
tree | f2a910cbea747a7b0c0a50d6c66691e54f5ef47f /module/plugins/ReCaptcha.py | |
parent | merged gui (diff) | |
download | pyload-29f9dc8fb3396b03d732ebcbeb1cc8f00fe13897.tar.xz |
new dirs
Diffstat (limited to 'module/plugins/ReCaptcha.py')
-rw-r--r-- | module/plugins/ReCaptcha.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/module/plugins/ReCaptcha.py b/module/plugins/ReCaptcha.py new file mode 100644 index 000000000..d29530a64 --- /dev/null +++ b/module/plugins/ReCaptcha.py @@ -0,0 +1,17 @@ +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) + + 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 |