From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/hooks/Captcha9Kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 60482b8fc..7f37c225e 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -10,13 +10,13 @@ from base64 import b64encode from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded class Captcha9Kw(Hook): __name__ = "Captcha9Kw" __type__ = "hook" - __version__ = "0.28" + __version__ = "0.29" __config__ = [("ssl" , "bool" , "Use HTTPS" , True ), ("force" , "bool" , "Force captcha resolving even if client is connected" , True ), -- cgit v1.2.3 From da1180bc2d428ad52fbbecda8473fc1fb7267438 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Jun 2015 01:52:24 +0200 Subject: [SimpleHoster] Improve checkFile --- module/plugins/hooks/Captcha9Kw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 7f37c225e..18a078bdb 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -139,7 +139,7 @@ class Captcha9Kw(Hook): self.logError(_("Bad upload: %s") % res) return - self.logDebug(_("NewCaptchaID ticket: %s") % res, task.captchaFile) + self.logDebug("NewCaptchaID ticket: %s" % res, task.captchaFile) task.data["ticket"] = res -- cgit v1.2.3 From f4b893e5ee24769584a2da1866c665489f7019ec Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 06:56:13 +0200 Subject: Hook plugin code cosmetics --- module/plugins/hooks/Captcha9Kw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 18a078bdb..ea15d7651 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -165,7 +165,7 @@ class Captcha9Kw(Hook): task.setResult(result) - def newCaptchaTask(self, task): + def captcha_task(self, task): if not task.isTextual() and not task.isPositional(): return -- cgit v1.2.3 From 5a139055ae658d3a05cbb658cbd66aeae0d01db5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 21:06:10 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/Captcha9Kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index ea15d7651..85bbb7924 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -246,9 +246,9 @@ class Captcha9Kw(Hook): self.logDebug("Could not send %s request: %s" % (type, res)) - def captchaCorrect(self, task): + def captcha_correct(self, task): self._captchaResponse(task, True) - def captchaInvalid(self, task): + def captcha_invalid(self, task): self._captchaResponse(task, False) -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/hooks/Captcha9Kw.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 85bbb7924..a67e5bfc3 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -8,8 +8,6 @@ import time from base64 import b64encode from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL - from module.plugins.internal.Hook import Hook, threaded @@ -48,7 +46,7 @@ class Captcha9Kw(Hook): def getCredits(self): - res = getURL(self.API_URL, + res = self.load(self.API_URL, get={'apikey': self.getConfig('passkey'), 'pyload': "1", 'source': "pyload", @@ -129,7 +127,7 @@ class Captcha9Kw(Hook): for _i in xrange(5): try: - res = getURL(self.API_URL, post=post_data) + res = self.load(self.API_URL, post=post_data) except BadHeader, e: time.sleep(3) else: @@ -144,7 +142,7 @@ class Captcha9Kw(Hook): task.data["ticket"] = res for _i in xrange(int(self.getConfig('timeout') / 5)): - result = getURL(self.API_URL, + result = self.load(self.API_URL, get={'apikey': self.getConfig('passkey'), 'id' : res, 'pyload': "1", @@ -186,7 +184,7 @@ class Captcha9Kw(Hook): pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) for _i in xrange(5): - servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") + servercheck = self.load("http://www.9kw.eu/grafik/servercheck.txt") if queue < re.search(r'queue=(\d+)', servercheck).group(1): break @@ -227,7 +225,7 @@ class Captcha9Kw(Hook): passkey = self.getConfig('passkey') for _i in xrange(3): - res = getURL(self.API_URL, + res = self.load(self.API_URL, get={'action' : "usercaptchacorrectback", 'apikey' : passkey, 'api_key': passkey, -- cgit v1.2.3 From 9305859b64a2f0aef3f27fb7e5b75caa0cb836a6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 19:24:49 +0200 Subject: Spare code cosmetics (3) --- module/plugins/hooks/Captcha9Kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index a67e5bfc3..7e9bd2071 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -139,7 +139,7 @@ class Captcha9Kw(Hook): self.logDebug("NewCaptchaID ticket: %s" % res, task.captchaFile) - task.data["ticket"] = res + task.data['ticket'] = res for _i in xrange(int(self.getConfig('timeout') / 5)): result = self.load(self.API_URL, @@ -232,7 +232,7 @@ class Captcha9Kw(Hook): 'correct': "1" if correct else "2", 'pyload' : "1", 'source' : "pyload", - 'id' : task.data["ticket"]}) + 'id' : task.data['ticket']}) self.logDebug("Request %s: %s" % (type, res)) -- cgit v1.2.3 From e4fb45b22d36595839e8f638a3f0a4669dba3e8d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 21 Jun 2015 08:50:26 +0200 Subject: Spare code cosmetics (4) --- module/plugins/hooks/Captcha9Kw.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 7e9bd2071..aaea232f7 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -16,8 +16,7 @@ class Captcha9Kw(Hook): __type__ = "hook" __version__ = "0.29" - __config__ = [("ssl" , "bool" , "Use HTTPS" , True ), - ("force" , "bool" , "Force captcha resolving even if client is connected" , True ), + __config__ = [("check_client" , "bool" , "Don't use if client is connected" , True ), ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), ("captchaperhour", "int" , "Captcha per hour" , "9999" ), ("captchapermin" , "int" , "Captcha per minute" , "9999" ), @@ -36,13 +35,11 @@ class Captcha9Kw(Hook): interval = 0 #@TODO: Remove in 0.4.10 - API_URL = "http://www.9kw.eu/index.cgi" + API_URL = "https://www.9kw.eu/index.cgi" def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - if self.getConfig('ssl'): - self.API_URL = self.API_URL.replace("http://", "https://") def getCredits(self): @@ -170,7 +167,7 @@ class Captcha9Kw(Hook): if not self.getConfig('passkey'): return - if self.core.isClientConnected() and not self.getConfig('force'): + if self.core.isClientConnected() and self.getConfig('check_client'): return credits = self.getCredits() -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hooks/Captcha9Kw.py | 72 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index aaea232f7..0ef67e54d 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -14,7 +14,7 @@ from module.plugins.internal.Hook import Hook, threaded class Captcha9Kw(Hook): __name__ = "Captcha9Kw" __type__ = "hook" - __version__ = "0.29" + __version__ = "0.30" __config__ = [("check_client" , "bool" , "Don't use if client is connected" , True ), ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), @@ -42,30 +42,30 @@ class Captcha9Kw(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def getCredits(self): + def get_credits(self): res = self.load(self.API_URL, - get={'apikey': self.getConfig('passkey'), + get={'apikey': self.get_config('passkey'), 'pyload': "1", 'source': "pyload", 'action': "usercaptchaguthaben"}) if res.isdigit(): - self.logInfo(_("%s credits left") % res) + self.log_info(_("%s credits left") % res) credits = self.info['credits'] = int(res) return credits else: - self.logError(res) + self.log_error(res) return 0 @threaded - def _processCaptcha(self, task): + def _process_captcha(self, task): try: with open(task.captchaFile, 'rb') as f: data = f.read() except IOError, e: - self.logError(e) + self.log_error(e) return pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) @@ -75,14 +75,14 @@ class Captcha9Kw(Hook): 'numeric' : 0, 'case_sensitive': 0, 'math' : 0, - 'prio' : min(max(self.getConfig('prio'), 0), 10), - 'confirm' : self.getConfig('confirm'), - 'timeout' : min(max(self.getConfig('timeout'), 300), 3999), - 'selfsolve' : self.getConfig('selfsolve'), - 'cph' : self.getConfig('captchaperhour'), - 'cpm' : self.getConfig('captchapermin')} + 'prio' : min(max(self.get_config('prio'), 0), 10), + 'confirm' : self.get_config('confirm'), + 'timeout' : min(max(self.get_config('timeout'), 300), 3999), + 'selfsolve' : self.get_config('selfsolve'), + 'cph' : self.get_config('captchaperhour'), + 'cpm' : self.get_config('captchapermin')} - for opt in str(self.getConfig('hoster_options').split('|')): + for opt in str(self.get_config('hoster_options').split('|')): details = map(str.strip, opt.split(':')) @@ -101,7 +101,7 @@ class Captcha9Kw(Hook): break - post_data = {'apikey' : self.getConfig('passkey'), + post_data = {'apikey' : self.get_config('passkey'), 'prio' : option['prio'], 'confirm' : option['confirm'], 'maxtimeout' : option['timeout'], @@ -131,16 +131,16 @@ class Captcha9Kw(Hook): if res and res.isdigit(): break else: - self.logError(_("Bad upload: %s") % res) + self.log_error(_("Bad upload: %s") % res) return - self.logDebug("NewCaptchaID ticket: %s" % res, task.captchaFile) + self.log_debug("NewCaptchaID ticket: %s" % res, task.captchaFile) task.data['ticket'] = res - for _i in xrange(int(self.getConfig('timeout') / 5)): + for _i in xrange(int(self.get_config('timeout') / 5)): result = self.load(self.API_URL, - get={'apikey': self.getConfig('passkey'), + get={'apikey': self.get_config('passkey'), 'id' : res, 'pyload': "1", 'info' : "1", @@ -152,10 +152,10 @@ class Captcha9Kw(Hook): else: break else: - self.logDebug("Could not send request: %s" % res) + self.log_debug("Could not send request: %s" % res) result = None - self.logInfo(_("Captcha result for ticket %s: %s") % (res, result)) + self.log_info(_("Captcha result for ticket %s: %s") % (res, result)) task.setResult(result) @@ -164,20 +164,20 @@ class Captcha9Kw(Hook): if not task.isTextual() and not task.isPositional(): return - if not self.getConfig('passkey'): + if not self.get_config('passkey'): return - if self.core.isClientConnected() and self.getConfig('check_client'): + if self.core.isClientConnected() and self.get_config('check_client'): return - credits = self.getCredits() + credits = self.get_credits() if not credits: - self.logError(_("Your captcha 9kw.eu account has not enough credits")) + self.log_error(_("Your captcha 9kw.eu account has not enough credits")) return - queue = min(self.getConfig('queue'), 999) - timeout = min(max(self.getConfig('timeout'), 300), 3999) + queue = min(self.get_config('queue'), 999) + timeout = min(max(self.get_config('timeout'), 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) for _i in xrange(5): @@ -189,7 +189,7 @@ class Captcha9Kw(Hook): else: self.fail(_("Too many captchas in queue")) - for opt in str(self.getConfig('hoster_options').split('|')): + for opt in str(self.get_config('hoster_options').split('|')): details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -209,17 +209,17 @@ class Captcha9Kw(Hook): task.setWaiting(timeout) - self._processCaptcha(task) + self._process_captcha(task) - def _captchaResponse(self, task, correct): + def _captcha_response(self, task, correct): type = "correct" if correct else "refund" if 'ticket' not in task.data: - self.logDebug("No CaptchaID for %s request (task: %s)" % (type, task)) + self.log_debug("No CaptchaID for %s request (task: %s)" % (type, task)) return - passkey = self.getConfig('passkey') + passkey = self.get_config('passkey') for _i in xrange(3): res = self.load(self.API_URL, @@ -231,19 +231,19 @@ class Captcha9Kw(Hook): 'source' : "pyload", 'id' : task.data['ticket']}) - self.logDebug("Request %s: %s" % (type, res)) + self.log_debug("Request %s: %s" % (type, res)) if res == "OK": break time.sleep(5) else: - self.logDebug("Could not send %s request: %s" % (type, res)) + self.log_debug("Could not send %s request: %s" % (type, res)) def captcha_correct(self, task): - self._captchaResponse(task, True) + self._captcha_response(task, True) def captcha_invalid(self, task): - self._captchaResponse(task, False) + self._captcha_response(task, False) -- cgit v1.2.3 From 502517f37c7540b0bddb092e69386d9d6f08800c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 09:42:34 +0200 Subject: Fix addons --- module/plugins/hooks/Captcha9Kw.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 0ef67e54d..ec989ae51 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -33,15 +33,9 @@ class Captcha9Kw(Hook): ("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - API_URL = "https://www.9kw.eu/index.cgi" - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def get_credits(self): res = self.load(self.API_URL, get={'apikey': self.get_config('passkey'), -- cgit v1.2.3 From 56389e28ba5d2f5658278bc7f486d73be747f135 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 11:44:49 +0200 Subject: Rename self.core to self.pyload (plugins only) --- module/plugins/hooks/Captcha9Kw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index ec989ae51..8006d9462 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -161,7 +161,7 @@ class Captcha9Kw(Hook): if not self.get_config('passkey'): return - if self.core.isClientConnected() and self.get_config('check_client'): + if self.pyload.isClientConnected() and self.get_config('check_client'): return credits = self.get_credits() -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hooks/Captcha9Kw.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 8006d9462..754af46bd 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -15,6 +15,7 @@ class Captcha9Kw(Hook): __name__ = "Captcha9Kw" __type__ = "hook" __version__ = "0.30" + __status__ = "stable" __config__ = [("check_client" , "bool" , "Don't use if client is connected" , True ), ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hooks/Captcha9Kw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 754af46bd..31638214e 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -15,7 +15,7 @@ class Captcha9Kw(Hook): __name__ = "Captcha9Kw" __type__ = "hook" __version__ = "0.30" - __status__ = "stable" + __status__ = "testing" __config__ = [("check_client" , "bool" , "Don't use if client is connected" , True ), ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), -- cgit v1.2.3 From 761ca5c66e07559925ebbdbc6531f9ca658b12ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 16:11:58 +0200 Subject: Code cosmetics --- module/plugins/hooks/Captcha9Kw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 31638214e..be01688e2 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -81,7 +81,7 @@ class Captcha9Kw(Hook): details = map(str.strip, opt.split(':')) - if not details or details[0].lower() != pluginname.lower(): + if not details or details[0].lower() not is pluginname.lower(): continue for d in details: @@ -187,14 +187,14 @@ class Captcha9Kw(Hook): for opt in str(self.get_config('hoster_options').split('|')): details = map(str.strip, opt.split(':')) - if not details or details[0].lower() != pluginname.lower(): + if not details or details[0].lower() not is pluginname.lower(): continue for d in details: hosteroption = d.split("=") if len(hosteroption) > 1 \ - and hosteroption[0].lower() == 'timeout' \ + and hosteroption[0].lower() == "timeout" \ and hosteroption[1].isdigit(): timeout = int(hosteroption[1]) -- cgit v1.2.3 From dd13825fbd3df9e441200638cd2a92e3924dfff6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 23:57:04 +0200 Subject: Fix typo --- module/plugins/hooks/Captcha9Kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index be01688e2..e9edbe7f9 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -81,7 +81,7 @@ class Captcha9Kw(Hook): details = map(str.strip, opt.split(':')) - if not details or details[0].lower() not is pluginname.lower(): + if not details or details[0].lower() is not pluginname.lower(): continue for d in details: @@ -187,7 +187,7 @@ class Captcha9Kw(Hook): for opt in str(self.get_config('hoster_options').split('|')): details = map(str.strip, opt.split(':')) - if not details or details[0].lower() not is pluginname.lower(): + if not details or details[0].lower() is not pluginname.lower(): continue for d in details: -- cgit v1.2.3 From e3799bcb0731e8cdf4d3f86ae6ee67e9cc5e4d80 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 31 Jul 2015 06:35:21 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1601 --- module/plugins/hooks/Captcha9Kw.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index e9edbe7f9..10d29e2c6 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -110,9 +110,9 @@ class Captcha9Kw(Hook): 'numeric' : option['numeric'], 'math' : option['math'], 'oldsource' : pluginname, - 'pyload' : "1", + 'pyload' : 1, 'source' : "pyload", - 'base64' : "1", + 'base64' : 1, 'mouse' : 1 if task.isPositional() else 0, 'file-upload-01': b64encode(data), 'action' : "usercaptchaupload"} @@ -120,11 +120,14 @@ class Captcha9Kw(Hook): for _i in xrange(5): try: res = self.load(self.API_URL, post=post_data) + except BadHeader, e: time.sleep(3) + else: if res and res.isdigit(): break + else: self.log_error(_("Bad upload: %s") % res) return -- cgit v1.2.3 From 04f4b7aa724454a69588ecc9fa46f7dd6e65c747 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 09:16:39 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1630 --- module/plugins/hooks/Captcha9Kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/Captcha9Kw.py') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 10d29e2c6..2e2685978 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -63,7 +63,7 @@ class Captcha9Kw(Hook): self.log_error(e) return - pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) + pluginname = re.search(r'_(.+?)_\d+.\w+', task.captchaFile).group(1) option = {'min' : 2, 'max' : 50, 'phrase' : 0, @@ -176,7 +176,7 @@ class Captcha9Kw(Hook): queue = min(self.get_config('queue'), 999) timeout = min(max(self.get_config('timeout'), 300), 3999) - pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) + pluginname = re.search(r'_(.+?)_\d+.\w+', task.captchaFile).group(1) for _i in xrange(5): servercheck = self.load("http://www.9kw.eu/grafik/servercheck.txt") -- cgit v1.2.3