From 7f19e76b0e58dec7e5715d90350dc5313f659ca1 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Thu, 8 Oct 2015 22:23:16 +0200 Subject: Addition of some debug messages in DlProtectCom.py and Captcha.py --- module/plugins/internal/Captcha.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/internal') diff --git a/module/plugins/internal/Captcha.py b/module/plugins/internal/Captcha.py index 333602e29..d30271dd4 100644 --- a/module/plugins/internal/Captcha.py +++ b/module/plugins/internal/Captcha.py @@ -38,6 +38,7 @@ class Captcha(Plugin): """ Extend to build your custom anti-captcha ocr """ + self.log_debug("This function does nothing") pass -- cgit v1.2.3 From f8b71e503e5aecfa8245e8aacb587aa4e38f936a Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Thu, 8 Oct 2015 23:30:49 +0200 Subject: Correction of some errors in OCR.py --- module/plugins/internal/OCR.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/internal') diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py index 89eed1832..b4e28ca0f 100644 --- a/module/plugins/internal/OCR.py +++ b/module/plugins/internal/OCR.py @@ -65,7 +65,7 @@ class OCR(Plugin): output = popen.stdout.read() + " | " + popen.stderr.read() popen.stdout.close() popen.stderr.close() - self.pyload.log_debug("Tesseract ReturnCode " + popen.returncode, "Output: " + output) + self.log_debug("Tesseract ReturnCode %d" % popen.returncode, "Output: %s" % output) def run_tesser(self, subset=False, digits=True, lowercase=True, uppercase=True, pagesegmode=None): @@ -82,7 +82,7 @@ class OCR(Plugin): self.log_error(e) return - self.pyload.log_debug("Saving tiff...") + self.log_debug("Saving tiff...") self.image.save(tmpTif.name, 'TIFF') if os.name is "nt": @@ -111,9 +111,9 @@ class OCR(Plugin): tessparams.append("nobatch") tessparams.append(os.path.abspath(tmpSub.name)) - self.pyload.log_debug("Running tesseract...") + self.log_debug("Running tesseract...") self.run(tessparams) - self.pyload.log_debug("Reading txt...") + self.log_debug("Reading txt...") try: with open(tmpTxt.name, 'r') as f: @@ -122,7 +122,7 @@ class OCR(Plugin): except Exception: self.result_captcha = "" - self.pyload.log_info(_("OCR result: ") + self.result_captcha) + self.log_info(_("OCR result: ") + self.result_captcha) try: os.remove(tmpTif.name) os.remove(tmpTxt.name) -- cgit v1.2.3 From 7eb0e3f633343b7e96053fdfd0342a5f4da50952 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Wed, 28 Oct 2015 02:53:26 +0100 Subject: Infinite redirect bug fixing in SimpleCrypter.py --- module/plugins/internal/SimpleCrypter.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'module/plugins/internal') diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index f37323f90..b36c3d528 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -149,24 +149,26 @@ class SimpleCrypter(Crypter): def handle_direct(self, pyfile): - link = None + redirect = None maxredirs = self.get_config("maxredirs", default=10, plugin="UserAgentSwitcher") for i in xrange(maxredirs): - url = link or pyfile.url - self.log_debug("Redirect #%d to: %s" % (i, url)) + redirect = redirect or pyfile.url + self.log_debug("Redirect #%d to: %s" % (i, redirect)) - header = self.load(url, just_header=True) + data = self.load(redirect) + header = dict(re.findall(r"(?P.+?): (?P.+?)\r?\n", self.req.http.header)) + #Ugly, but there is no direct way to fetch headers AND data location = header.get('location') if location: - link = location - - elif link: - self.links.append(link) + redirect = location + else: + self.data = data + self.links.extend(self.get_links()) return else: - self.log_warning(_("Too many redirects")) + self.log_error(_("Too many redirects")) def preload(self): -- cgit v1.2.3 From 4812b211ef351e9c932b62aa2e488f0a833100df Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Wed, 28 Oct 2015 02:54:18 +0100 Subject: Increase version number in SimpleCrypter.py --- module/plugins/internal/SimpleCrypter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/internal') diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index b36c3d528..59b9acc31 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -11,7 +11,7 @@ from module.plugins.internal.utils import replace_patterns, set_cookie, set_cook class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.78" + __version__ = "0.79" __status__ = "testing" __pattern__ = r'^unmatchable$' -- cgit v1.2.3