summaryrefslogtreecommitdiffstats
path: root/module/plugins/ReCaptcha.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-08-13 13:09:21 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-08-13 13:09:21 +0200
commitdae3ed77f3a36ba81c051bc3f47bdaeabcc4f129 (patch)
tree1fbb1516d50783f9d246fc31402c12d00dbcd209 /module/plugins/ReCaptcha.py
parentunrar hook :D, account fix, other fixes (diff)
downloadpyload-dae3ed77f3a36ba81c051bc3f47bdaeabcc4f129.tar.xz
recaptcha + new crypter lof.cc
Diffstat (limited to 'module/plugins/ReCaptcha.py')
-rw-r--r--module/plugins/ReCaptcha.py19
1 files changed, 19 insertions, 0 deletions
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