From a3ecb6eaa2b449c15ce6367e21b3744401e5ab18 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Mon, 1 Oct 2012 23:52:18 +0200 Subject: rapidgator.net premium, novafile.com free, multihoster schedule refresh --- module/plugins/internal/CaptchaService.py | 79 +++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 module/plugins/internal/CaptchaService.py (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py new file mode 100644 index 000000000..8be442d37 --- /dev/null +++ b/module/plugins/internal/CaptchaService.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: zoidberg +""" + +import re + +class CaptchaService() + __version__ = "0.01" + + def __init__(self, plugin): + self.plugin = plugin + +class ReCaptcha(): + def __init__(self, plugin): + self.plugin = plugin + + def challenge(self, id): + js = self.plugin.req.load("http://www.google.com/recaptcha/api/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.result(server,challenge) + + return challenge, result + + def result(self, server, challenge): + return self.plugin.decryptCaptcha("%simage"%server, get={"c":challenge}, cookies=True, forceUser=True, imgtype="jpg") + +class AdsCaptcha(CaptchaService): + def challenge(self, src): + js = self.plugin.req.load(src, cookies=True) + + try: + challenge = re.search("challenge: '(.*?)',", js).group(1) + server = re.search("server: '(.*?)',", js).group(1) + except: + self.plugin.fail("adscaptcha error") + result = self.result(server,challenge) + + return challenge, result + + def result(self, server, challenge): + return self.plugin.decryptCaptcha("%sChallenge.aspx" % server, get={"cid": challenge, "dummy": random()}, cookies=True, imgtype="jpg") + +class SolveMedia(CaptchaService): + def __init__(self,plugin): + self.plugin = plugin + + def challenge(self, src): + html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.script?k=%s" % src, cookies=True) + try: + ckey = re.search("ckey:.*?'(.*?)',",html).group(1) + html = self.plugin.req.load("http://api.solvemedia.com/papi/_challenge.js?k=%s" % ckey, cookies=True) + challenge = re.search('"chid".*?: "(.*?)"',html).group(1) + except: + self.plugin.fail("solvmedia error") + result = self.result(challenge) + + return challenge, result + + def result(self,challenge): + return self.plugin.decryptCaptcha("http://api.solvemedia.com/papi/media?c=%s" % challenge,imgtype="gif") \ No newline at end of file -- cgit v1.2.3 From 5658d5525d5088a6254322210c1641cbdba2eb7d Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Wed, 3 Oct 2012 01:14:48 +0200 Subject: update czshare, little fixes --- module/plugins/internal/CaptchaService.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index 8be442d37..f2de00732 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -18,7 +18,7 @@ import re -class CaptchaService() +class CaptchaService(): __version__ = "0.01" def __init__(self, plugin): -- cgit v1.2.3 From f53e80f96773c2af95938f206d9949b4042500f9 Mon Sep 17 00:00:00 2001 From: Stefano Codari Date: Tue, 19 Mar 2013 21:27:26 +0100 Subject: Solvemedia Captcha: implemented in a better way trying to fix bug #21 --- module/plugins/internal/CaptchaService.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index f2de00732..b912436a7 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -19,7 +19,7 @@ import re class CaptchaService(): - __version__ = "0.01" + __version__ = "0.02" def __init__(self, plugin): self.plugin = plugin @@ -64,11 +64,9 @@ class SolveMedia(CaptchaService): self.plugin = plugin def challenge(self, src): - html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.script?k=%s" % src, cookies=True) + html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.noscript?k=%s" % src, cookies=True) try: - ckey = re.search("ckey:.*?'(.*?)',",html).group(1) - html = self.plugin.req.load("http://api.solvemedia.com/papi/_challenge.js?k=%s" % ckey, cookies=True) - challenge = re.search('"chid".*?: "(.*?)"',html).group(1) + challenge = re.search(r'', html).group(1) except: self.plugin.fail("solvmedia error") result = self.result(challenge) -- cgit v1.2.3