From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hooks/Captcha9kw.py | 8 +++++--- 1 file changed, 5 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 c86f92972..28bce3d2b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay, RaNaN, zoidberg """ from __future__ import with_statement @@ -31,7 +29,8 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __version__ = "0.09" - __description__ = """Send captchas to 9kw.eu""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), ("https", "bool", "Enable HTTPS", False), @@ -43,11 +42,14 @@ class Captcha9kw(Hook): False), ("timeout", "int", "Timeout (max. 300)", 300), ("passkey", "password", "API key", "")] + + __description__ = """Send captchas to 9kw.eu""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" API_URL = "://www.9kw.eu/index.cgi" + def setup(self): self.API_URL = "https" + self.API_URL if self.getConfig("https") else "http" + self.API_URL self.info = {} -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hooks/Captcha9kw.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 28bce3d2b..b4e3ad34b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -60,7 +60,7 @@ class Captcha9kw(Hook): if response.isdigit(): self.logInfo(_("%s credits left") % response) - self.info["credits"] = credits = int(response) + self.info['credits'] = credits = int(response) return credits else: self.logError(response) @@ -106,7 +106,7 @@ class Captcha9kw(Hook): time.sleep(3) result = response2 - task.data["ticket"] = response + task.data['ticket'] = response self.logInfo("result %s : %s" % (response, result)) task.setResult(result) else: @@ -142,7 +142,7 @@ class Captcha9kw(Hook): "correct": "1", "pyload": "1", "source": "pyload", - "id": task.data["ticket"]}) + "id": task.data['ticket']}) self.logInfo("Request correct: %s" % response) except BadHeader, e: @@ -161,7 +161,7 @@ class Captcha9kw(Hook): "correct": "2", "pyload": "1", "source": "pyload", - "id": task.data["ticket"]}) + "id": task.data['ticket']}) self.logInfo("Request refund: %s" % response) except BadHeader, e: -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hooks/Captcha9kw.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index b4e3ad34b..1b7406edd 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -1,35 +1,21 @@ # -*- 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 . -""" from __future__ import with_statement -from thread import start_new_thread -from base64 import b64encode import time -from module.network.RequestFactory import getURL -from module.network.HTTPRequest import BadHeader +from base64 import b64encode +from thread import start_new_thread +from module.network.HTTPRequest import BadHeader +from module.network.RequestFactory import getURL from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" - __version__ = "0.09" __type__ = "hook" + __version__ = "0.09" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hooks/Captcha9kw.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 1b7406edd..7a54bb784 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -58,7 +58,7 @@ class Captcha9kw(Hook): with open(task.captchaFile, 'rb') as f: data = f.read() data = b64encode(data) - self.logDebug("%s : %s" % (task.captchaFile, data)) + self.logDebug(task.captchaFile, data) if task.isPositional(): mouse = 1 else: @@ -93,10 +93,10 @@ class Captcha9kw(Hook): result = response2 task.data['ticket'] = response - self.logInfo("result %s : %s" % (response, result)) + self.logInfo(_("Result %s : %s") % (response, result)) task.setResult(result) else: - self.logError("Bad upload: %s" % response) + self.logError(_("Bad upload"), response) return False def newCaptchaTask(self, task): @@ -129,12 +129,12 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo("Request correct: %s" % response) + self.logInfo(_("Request correct", response) except BadHeader, e: - self.logError("Could not send correct request.", str(e)) + self.logError(_("Could not send correct request."), e) else: - self.logError("No CaptchaID for correct request (task %s) found." % task) + self.logError(_("No CaptchaID for correct request (task %s) found.") % task) def captchaInvalid(self, task): if "ticket" in task.data: @@ -148,9 +148,9 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo("Request refund: %s" % response) + self.logInfo(_("Request refund", response) except BadHeader, e: - self.logError("Could not send refund request.", str(e)) + self.logError(_("Could not send refund request."), e) else: - self.logError("No CaptchaID for not correct request (task %s) found." % task) + self.logError(_("No CaptchaID for not correct request (task %s) found.") % task) -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- 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 7a54bb784..bef5c6b01 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -30,8 +30,8 @@ class Captcha9kw(Hook): ("passkey", "password", "API key", "")] __description__ = """Send captchas to 9kw.eu""" - __author_name__ = "RaNaN" - __author_mail__ = "RaNaN@pyload.org" + __authors__ = [("RaNaN", "RaNaN@pyload.org")] + API_URL = "://www.9kw.eu/index.cgi" -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- 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 bef5c6b01..7c1fa40fd 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -30,6 +30,7 @@ class Captcha9kw(Hook): ("passkey", "password", "API key", "")] __description__ = """Send captchas to 9kw.eu""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org")] -- cgit v1.2.3 From e24a10387d38c706839a4d86e1b23780c52e9a5b Mon Sep 17 00:00:00 2001 From: eerozeteen Date: Wed, 22 Oct 2014 08:22:31 +0200 Subject: Update Captcha9kw.py syntax error, added missing parentheses --- 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 7c1fa40fd..4eb7e0ffc 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -130,7 +130,7 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo(_("Request correct", response) + self.logInfo(_("Request correct"), response) except BadHeader, e: self.logError(_("Could not send correct request."), e) @@ -149,7 +149,7 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo(_("Request refund", response) + self.logInfo(_("Request refund"), response) except BadHeader, e: self.logError(_("Could not send refund request."), e) -- cgit v1.2.3 From f00dbe52cee93a0aad9b6747419ff7271adb6e84 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 10:12:21 +0200 Subject: 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 4eb7e0ffc..6485db22b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -15,7 +15,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hooks/Captcha9kw.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 6485db22b..947aff121 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -41,6 +41,7 @@ class Captcha9kw(Hook): self.API_URL = "https" + self.API_URL if self.getConfig("https") else "http" + self.API_URL self.info = {} + def getCredits(self): response = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "pyload": "1", "source": "pyload", "action": "usercaptchaguthaben"}) @@ -53,6 +54,7 @@ class Captcha9kw(Hook): self.logError(response) return 0 + def processCaptcha(self, task): result = None @@ -100,6 +102,7 @@ class Captcha9kw(Hook): self.logError(_("Bad upload"), response) return False + def newCaptchaTask(self, task): if not task.isTextual() and not task.isPositional(): return False @@ -118,6 +121,7 @@ class Captcha9kw(Hook): else: self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) + def captchaCorrect(self, task): if "ticket" in task.data: @@ -137,6 +141,7 @@ class Captcha9kw(Hook): else: self.logError(_("No CaptchaID for correct request (task %s) found.") % task) + def captchaInvalid(self, task): if "ticket" in task.data: -- cgit v1.2.3 From 1c4bf83881d2a22da3773666a580d51f6b57bfd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 03:07:21 +0200 Subject: Avoid gettext conflict due variable `_` --- 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 947aff121..930293002 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -84,7 +84,7 @@ class Captcha9kw(Hook): if response.isdigit(): self.logInfo(_("New CaptchaID from upload: %s : %s") % (response, task.captchaFile)) - for _ in xrange(1, 100, 1): + for _i in xrange(1, 100, 1): response2 = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "id": response, "pyload": "1", "source": "pyload", "action": "usercaptchacorrectdata"}) -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hooks/Captcha9kw.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 930293002..7bbfa2e73 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -137,9 +137,9 @@ class Captcha9kw(Hook): self.logInfo(_("Request correct"), response) except BadHeader, e: - self.logError(_("Could not send correct request."), e) + self.logError(_("Could not send correct request"), repr(e)) else: - self.logError(_("No CaptchaID for correct request (task %s) found.") % task) + self.logError(_("No CaptchaID for correct request (task %s) found") % task) def captchaInvalid(self, task): @@ -157,6 +157,6 @@ class Captcha9kw(Hook): self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError(_("Could not send refund request."), e) + self.logError(_("Could not send refund request"), repr(e)) else: - self.logError(_("No CaptchaID for not correct request (task %s) found.") % task) + self.logError(_("No CaptchaID for not correct request (task %s) found") % task) -- cgit v1.2.3 From 146fe1e309c33ab149bfaf58ad86c0dd4fb9b156 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Oct 2014 01:18:45 +0100 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 7bbfa2e73..eb6313bc0 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -137,7 +137,7 @@ class Captcha9kw(Hook): self.logInfo(_("Request correct"), response) except BadHeader, e: - self.logError(_("Could not send correct request"), repr(e)) + self.logError(_("Could not send correct request"), str(e)) else: self.logError(_("No CaptchaID for correct request (task %s) found") % task) @@ -157,6 +157,6 @@ class Captcha9kw(Hook): self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError(_("Could not send refund request"), repr(e)) + self.logError(_("Could not send refund request"), str(e)) else: self.logError(_("No CaptchaID for not correct request (task %s) found") % task) -- cgit v1.2.3 From 885f8ed782e64d9e73367905e642a84d0a8999f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 04:01:38 +0100 Subject: Update __config__ --- module/plugins/hooks/Captcha9kw.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index eb6313bc0..4ab163358 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,8 +17,7 @@ class Captcha9kw(Hook): __type__ = "hook" __version__ = "0.10" - __config__ = [("activated", "bool", "Activated", False), - ("force", "bool", "Force CT even if client is connected", True), + __config__ = [("force", "bool", "Force CT even if client is connected", True), ("https", "bool", "Enable HTTPS", False), ("confirm", "bool", "Confirm Captcha (Cost +6)", False), ("captchaperhour", "int", "Captcha per hour (max. 9999)", 9999), -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hooks/Captcha9kw.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 4ab163358..b8aa2fd78 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -13,8 +13,8 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): - __name__ = "Captcha9kw" - __type__ = "hook" + __name__ = "Captcha9kw" + __type__ = "hook" __version__ = "0.10" __config__ = [("force", "bool", "Force CT even if client is connected", True), @@ -29,8 +29,8 @@ class Captcha9kw(Hook): ("passkey", "password", "API key", "")] __description__ = """Send captchas to 9kw.eu""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org")] API_URL = "://www.9kw.eu/index.cgi" -- cgit v1.2.3 From ba8429ea41fdf142a0f8c0f116c82e70c9c018bb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 8 Nov 2014 14:35:06 +0100 Subject: [Captcha9kw] Update --- module/plugins/hooks/Captcha9kw.py | 291 ++++++++++++++++++++++++------------- 1 file changed, 186 insertions(+), 105 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index b8aa2fd78..0b0de8ba5 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -2,160 +2,241 @@ from __future__ import with_statement -import time +import re from base64 import b64encode from thread import start_new_thread +from time import sleep from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL + from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.13" - __config__ = [("force", "bool", "Force CT even if client is connected", True), - ("https", "bool", "Enable HTTPS", False), + __config__ = [("activated", "bool", "Activated", True), + ("force", "bool", "Force captcha resolving even if client is connected", True), ("confirm", "bool", "Confirm Captcha (Cost +6)", False), - ("captchaperhour", "int", "Captcha per hour (max. 9999)", 9999), - ("prio", "int", "Prio 1-10 (Cost +1-10)", 0), - ("selfsolve", "bool", - "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", - False), - ("timeout", "int", "Timeout (max. 300)", 300), - ("passkey", "password", "API key", "")] + ("captchaperhour", "int", "Captcha per hour", "9999"), + ("prio", "int", "Priority (max. 20)(Cost +0 -> +20)", "0"), + ("queue", "int", "Max. Queue (max. 999)", "0"), + ("hoster_options", "string", "Hoster options (Format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900;)", "ShareonlineBiz:prio=0:timeout=999;UploadedTo:prio=0:timeout=999;SerienjunkiesOrg:prio=1:min=3;max=3;timeout=90"), + ("selfsolve", "bool", "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", "0"), + ("passkey", "password", "API key", ""), + ("timeout", "int", "Timeout (min. 60s, max. 3999s)", "900")] __description__ = """Send captchas to 9kw.eu""" __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org")] + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("Walter Purcaro", "vuolter@gmail.com")] - API_URL = "://www.9kw.eu/index.cgi" + API_URL = "http://www.9kw.eu/index.cgi" def setup(self): - self.API_URL = "https" + self.API_URL if self.getConfig("https") else "http" + self.API_URL - self.info = {} + self.info = {} #@TODO: Remove in 0.4.10 def getCredits(self): - response = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "pyload": "1", "source": "pyload", - "action": "usercaptchaguthaben"}) - - if response.isdigit(): - self.logInfo(_("%s credits left") % response) - self.info['credits'] = credits = int(response) + res = getURL(self.API_URL, + get={'apikey': self.getConfig("passkey"), + 'pyload': "1", + 'source': "pyload", + 'action': "usercaptchaguthaben"}) + + if res.isdigit(): + self.logInfo(_("%d credits left") % res) + credits = self.info["credits"] = int(res) return credits else: - self.logError(response) + self.logError(res) return 0 - def processCaptcha(self, task): - result = None + def _processCaptcha(self, task): + try: + with open(task.captchaFile, 'rb') as f: + data = f.read() + except IOError, e: + self.logError(str(e)) + return - with open(task.captchaFile, 'rb') as f: - data = f.read() data = b64encode(data) - self.logDebug(task.captchaFile, data) - if task.isPositional(): - mouse = 1 - else: - mouse = 0 - - response = getURL(self.API_URL, post={ - "apikey": self.getConfig("passkey"), - "prio": self.getConfig("prio"), - "confirm": self.getConfig("confirm"), - "captchaperhour": self.getConfig("captchaperhour"), - "maxtimeout": self.getConfig("timeout"), - "selfsolve": self.getConfig("selfsolve"), - "pyload": "1", - "source": "pyload", - "base64": "1", - "mouse": mouse, - "file-upload-01": data, - "action": "usercaptchaupload"}) - - if response.isdigit(): - self.logInfo(_("New CaptchaID from upload: %s : %s") % (response, task.captchaFile)) - - for _i in xrange(1, 100, 1): - response2 = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "id": response, - "pyload": "1", "source": "pyload", - "action": "usercaptchacorrectdata"}) - - if response2 != "": + mouse = 1 if task.isPositional() else 0 + pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) + + self.logDebug("%s: %s" % (task.captchaFile, data)) + + option = {'min' : 2 + 'max' : 50 + 'phrase' : 0 + 'numeric' : 0 + 'case_sensitive' : 0 + 'math' : 0 + 'prio' : self.getConfig("prio") + 'confirm' : self.getConfig("confirm") + 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999) + 'selfsolve' : self.getConfig("selfsolve") + 'cph' : self.getConfig("captchaperhour") + 'hoster_options' : self.getConfig("hoster_options").split(";")} + + for opt in hoster_options: + details = opt.split(":") + + if not details or details[0].lower() != pluginname.lower(): + continue + + for d in details: + hosteroption = d.split("=") + + if len(hosteroption) <= 1 or not hosteroption[1].isdigit(): + continue + + o = hosteroption[0].lower() + if o in option: + option[o] = hosteroption[1] + + for _ in xrange(5): + post_data = {'apikey' : self.getConfig("passkey"), + 'prio' : prio_option, + 'confirm' : confirm_option, + 'maxtimeout' : timeout_option, + 'selfsolve' : selfsolve_option, + 'captchaperhour': cph_option, + 'case-sensitive': case_sensitive_option, + 'min_len' : min_option, + 'max_len' : max_option, + 'phrase' : phrase_option, + 'numeric' : numeric_option, + 'math' : math_option, + 'oldsource' : pluginname, + 'pyload' : "1", + 'source' : "pyload", + 'base64' : "1", + 'mouse' : mouse, + 'file-upload-01': data, + 'action' : "usercaptchaupload"} + try: + res = getURL(self.API_URL, post=post_data) + if res: break + except BadHeader, e: + sleep(3) - time.sleep(3) + if not res.isdigit(): + self.logError(_("Bad upload: %s") % res) + return - result = response2 - task.data['ticket'] = response - self.logInfo(_("Result %s : %s") % (response, result)) - task.setResult(result) - else: - self.logError(_("Bad upload"), response) - return False + self.logInfo(_("NewCaptchaID from upload: %s : %s") % (res, task.captchaFile)) + + task.data["ticket"] = res + self.logInfo("result %s : %s" % (res, result)) + + for _ in xrange(int(self.getConfig("timeout") / 5)): + res2 = getURL(self.API_URL, + get={'apikey': self.getConfig("passkey"), + 'id' : res, + 'pyload': "1", + 'info' : "1", + 'source': "pyload", + 'action': "usercaptchacorrectdata"}) + + if not res2 or res2 == "NO DATA": + sleep(5) + else: + break + + task.setResult(res2 or None) def newCaptchaTask(self, task): if not task.isTextual() and not task.isPositional(): - return False + return - if not self.getConfig("passkey"): - return False + elif not self.getConfig("passkey"): + return - if self.core.isClientConnected() and not self.getConfig("force"): - return False + elif self.core.isClientConnected() and not self.getConfig("force"): + return - if self.getCredits() > 0: - task.handler.append(self) - task.setWaiting(self.getConfig("timeout")) - start_new_thread(self.processCaptcha, (task,)) + credits = self.getCredits() - else: + if not credits: self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) + return + queue = self.getConfig("queue") + timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) + hoster_options = self.getConfig("hoster_options").split(";") + pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - def captchaCorrect(self, task): - if "ticket" in task.data: + if 1000 > queue > 10: + servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") + regex = re.compile("queue=(\d+)") - try: - response = getURL(self.API_URL, - post={"action": "usercaptchacorrectback", - "apikey": self.getConfig("passkey"), - "api_key": self.getConfig("passkey"), - "correct": "1", - "pyload": "1", - "source": "pyload", - "id": task.data['ticket']}) - self.logInfo(_("Request correct"), response) + for _ in xrange(3): + if queue < regex.search(servercheck).group(1): + break - except BadHeader, e: - self.logError(_("Could not send correct request"), str(e)) - else: - self.logError(_("No CaptchaID for correct request (task %s) found") % task) + sleep(10) + for opt in hoster_options: + details = opt.split(":") - def captchaInvalid(self, task): - if "ticket" in task.data: + if not details or details[0].lower() != pluginname.lower(): + continue - try: - response = getURL(self.API_URL, - post={"action": "usercaptchacorrectback", - "apikey": self.getConfig("passkey"), - "api_key": self.getConfig("passkey"), - "correct": "2", - "pyload": "1", - "source": "pyload", - "id": task.data['ticket']}) - self.logInfo(_("Request refund"), response) + for d in details: + hosteroption = d.split("=") - except BadHeader, e: - self.logError(_("Could not send refund request"), str(e)) - else: - self.logError(_("No CaptchaID for not correct request (task %s) found") % task) + if (len(hosteroption) > 1 + and hosteroption[0].lower() == 'timeout' + and hosteroption[1].isdigit()): + timeout = int(hosteroption[1]) + + task.handler.append(self) + + task.setWaiting(timeout) + + start_new_thread(self._processCaptcha, (task,)) + + + def _captchaResponse(self, task, correct): + if "ticket" not in task.data: + return + + type = "correct" if correct else "refund" + passkey = self.getConfig("passkey") + + for _ in xrange(3): + res = getURL(self.API_URL, + get={'action' : "usercaptchacorrectback", + 'apikey' : passkey, + 'api_key': passkey, + 'correct': "1" if correct else "2", + 'pyload' : "1", + 'source' : "pyload", + 'id' : task.data["ticket"]}) + + if res is "OK": + self.logInfo(_("Request %s: %s" % type) % res) + return + else: + self.logDebug(_("Could not send %s request: %s" % type) % res) + sleep(1) + else: + self.logDebug(_("No CaptchaID for %s request (task: %s)" % type) % task) + + + def captchaCorrect(self, task): + self._captchaResponse(self, task, True) + + + def captchaInvalid(self, task): + self._captchaResponse(self, task, False) -- cgit v1.2.3 From d6ef06aa8f1e2de97cf22e6895b631da0a8bb816 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 9 Nov 2014 02:44:07 +0100 Subject: [Captcha9kw] Fix a couple of typo --- module/plugins/hooks/Captcha9kw.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 0b0de8ba5..af12ca830 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -73,17 +73,17 @@ class Captcha9kw(Hook): self.logDebug("%s: %s" % (task.captchaFile, data)) - option = {'min' : 2 - 'max' : 50 - 'phrase' : 0 - 'numeric' : 0 - 'case_sensitive' : 0 - 'math' : 0 - 'prio' : self.getConfig("prio") - 'confirm' : self.getConfig("confirm") - 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999) - 'selfsolve' : self.getConfig("selfsolve") - 'cph' : self.getConfig("captchaperhour") + option = {'min' : 2, + 'max' : 50, + 'phrase' : 0, + 'numeric' : 0, + 'case_sensitive' : 0, + 'math' : 0, + 'prio' : self.getConfig("prio"), + 'confirm' : self.getConfig("confirm"), + 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), + 'selfsolve' : self.getConfig("selfsolve"), + 'cph' : self.getConfig("captchaperhour"), 'hoster_options' : self.getConfig("hoster_options").split(";")} for opt in hoster_options: @@ -209,6 +209,7 @@ class Captcha9kw(Hook): def _captchaResponse(self, task, correct): if "ticket" not in task.data: + self.logDebug(_("No CaptchaID for %s request (task: %s)" % type) % task) return type = "correct" if correct else "refund" @@ -230,8 +231,6 @@ class Captcha9kw(Hook): else: self.logDebug(_("Could not send %s request: %s" % type) % res) sleep(1) - else: - self.logDebug(_("No CaptchaID for %s request (task: %s)" % type) % task) def captchaCorrect(self, task): -- cgit v1.2.3 From 92fbe511be5cbcc96f2d286c25ffd552e4940f3b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 9 Nov 2014 16:16:08 +0100 Subject: [Captcha9kw] Fix indentation --- module/plugins/hooks/Captcha9kw.py | 14 +++++++------- 1 file changed, 7 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 af12ca830..e831d977c 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -176,12 +176,12 @@ class Captcha9kw(Hook): hoster_options = self.getConfig("hoster_options").split(";") pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - if 1000 > queue > 10: - servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") + if 1000 > queue > 10: + servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") regex = re.compile("queue=(\d+)") - for _ in xrange(3): - if queue < regex.search(servercheck).group(1): + for _ in xrange(3): + if queue < regex.search(servercheck).group(1): break sleep(10) @@ -201,9 +201,9 @@ class Captcha9kw(Hook): timeout = int(hosteroption[1]) task.handler.append(self) - + task.setWaiting(timeout) - + start_new_thread(self._processCaptcha, (task,)) -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: 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 e831d977c..c8f034847 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -64,7 +64,7 @@ class Captcha9kw(Hook): with open(task.captchaFile, 'rb') as f: data = f.read() except IOError, e: - self.logError(str(e)) + self.logError(e) return data = b64encode(data) -- cgit v1.2.3 From fa6662c3352d4eea43b42e66fc80cabcc85709e9 Mon Sep 17 00:00:00 2001 From: Velociraptor85 Date: Mon, 10 Nov 2014 23:00:53 +0100 Subject: Format error in Default config see Hoster Options --- 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 c8f034847..11fbf6448 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -25,7 +25,7 @@ class Captcha9kw(Hook): ("captchaperhour", "int", "Captcha per hour", "9999"), ("prio", "int", "Priority (max. 20)(Cost +0 -> +20)", "0"), ("queue", "int", "Max. Queue (max. 999)", "0"), - ("hoster_options", "string", "Hoster options (Format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900;)", "ShareonlineBiz:prio=0:timeout=999;UploadedTo:prio=0:timeout=999;SerienjunkiesOrg:prio=1:min=3;max=3;timeout=90"), + ("hoster_options", "string", "Hoster options (Format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900;)", "ShareonlineBiz:prio=0:timeout=999;UploadedTo:prio=0:timeout=999;SerienjunkiesOrg:prio=1:min=3:max=3:timeout=90;"), ("selfsolve", "bool", "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", "0"), ("passkey", "password", "API key", ""), ("timeout", "int", "Timeout (min. 60s, max. 3999s)", "900")] -- cgit v1.2.3 From 5f8d4cd870dc9865184266b4b256c529a414d425 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 23:28:20 +0100 Subject: [Captcha9kw] Improve __config__ --- module/plugins/hooks/Captcha9kw.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 11fbf6448..e7816168d 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,18 +17,18 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), - ("confirm", "bool", "Confirm Captcha (Cost +6)", False), + ("confirm", "bool", "Confirm Captcha (cost +6 credits)", False), ("captchaperhour", "int", "Captcha per hour", "9999"), - ("prio", "int", "Priority (max. 20)(Cost +0 -> +20)", "0"), - ("queue", "int", "Max. Queue (max. 999)", "0"), - ("hoster_options", "string", "Hoster options (Format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900;)", "ShareonlineBiz:prio=0:timeout=999;UploadedTo:prio=0:timeout=999;SerienjunkiesOrg:prio=1:min=3:max=3:timeout=90;"), - ("selfsolve", "bool", "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", "0"), + ("prio", "int", "Priority (max 20)(cost +0 -> +20 credits)", "0"), + ("queue", "int", "Max. Queue (max 999)", "0"), + ("hoster_options", "string", "Hoster options (format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900|...)", "ShareonlineBiz:prio=0:timeout=999 | UploadedTo:prio=0:timeout=999"), + ("selfsolve", "bool", "Selfsolve (manually solve your captcha in your 9kw client if active)", "0"), ("passkey", "password", "API key", ""), - ("timeout", "int", "Timeout (min. 60s, max. 3999s)", "900")] + ("timeout", "int", "Timeout in seconds (min 60, max 3999)", "900")] __description__ = """Send captchas to 9kw.eu""" __license__ = "GPLv3" @@ -84,10 +84,10 @@ class Captcha9kw(Hook): 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), 'selfsolve' : self.getConfig("selfsolve"), 'cph' : self.getConfig("captchaperhour"), - 'hoster_options' : self.getConfig("hoster_options").split(";")} + 'hoster_options' : self.getConfig("hoster_options").split('|')} for opt in hoster_options: - details = opt.split(":") + details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): continue @@ -173,7 +173,7 @@ class Captcha9kw(Hook): queue = self.getConfig("queue") timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) - hoster_options = self.getConfig("hoster_options").split(";") + hoster_options = self.getConfig("hoster_options").split('|') pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) if 1000 > queue > 10: @@ -187,7 +187,7 @@ class Captcha9kw(Hook): sleep(10) for opt in hoster_options: - details = opt.split(":") + details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): continue -- cgit v1.2.3 From c1ef8bc0bc79c06b2351493b5f49153fa3f59980 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 11 Nov 2014 00:34:38 +0100 Subject: [Captcha9kw] Some fixes (thx Nippey) --- module/plugins/hooks/Captcha9kw.py | 62 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index e7816168d..cc56ad4a2 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -51,7 +51,7 @@ class Captcha9kw(Hook): 'action': "usercaptchaguthaben"}) if res.isdigit(): - self.logInfo(_("%d credits left") % res) + self.logInfo(_("%s credits left") % res) credits = self.info["credits"] = int(res) return credits else: @@ -73,20 +73,20 @@ class Captcha9kw(Hook): self.logDebug("%s: %s" % (task.captchaFile, data)) - option = {'min' : 2, - 'max' : 50, - 'phrase' : 0, - 'numeric' : 0, - 'case_sensitive' : 0, - 'math' : 0, - 'prio' : self.getConfig("prio"), - 'confirm' : self.getConfig("confirm"), - 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), - 'selfsolve' : self.getConfig("selfsolve"), - 'cph' : self.getConfig("captchaperhour"), - 'hoster_options' : self.getConfig("hoster_options").split('|')} - - for opt in hoster_options: + option = {'min' : 2, + 'max' : 50, + 'phrase' : 0, + 'numeric' : 0, + 'case_sensitive': 0, + 'math' : 0, + 'prio' : self.getConfig("prio"), + 'confirm' : self.getConfig("confirm"), + 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), + 'selfsolve' : self.getConfig("selfsolve"), + 'cph' : self.getConfig("captchaperhour")} + + for opt in self.getConfig("hoster_options").split('|'): + details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -104,17 +104,17 @@ class Captcha9kw(Hook): for _ in xrange(5): post_data = {'apikey' : self.getConfig("passkey"), - 'prio' : prio_option, - 'confirm' : confirm_option, - 'maxtimeout' : timeout_option, - 'selfsolve' : selfsolve_option, - 'captchaperhour': cph_option, - 'case-sensitive': case_sensitive_option, - 'min_len' : min_option, - 'max_len' : max_option, - 'phrase' : phrase_option, - 'numeric' : numeric_option, - 'math' : math_option, + 'prio' : option['prio'], + 'confirm' : option['confirm'], + 'maxtimeout' : option['timeout'], + 'selfsolve' : option['selfsolve'], + 'captchaperhour': option['cph'], + 'case-sensitive': option['case_sensitive'], + 'min_len' : option['min'], + 'max_len' : option['max'], + 'phrase' : option['phrase'], + 'numeric' : option['numeric'], + 'math' : option['math'], 'oldsource' : pluginname, 'pyload' : "1", 'source' : "pyload", @@ -173,7 +173,6 @@ class Captcha9kw(Hook): queue = self.getConfig("queue") timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) - hoster_options = self.getConfig("hoster_options").split('|') pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) if 1000 > queue > 10: @@ -186,7 +185,8 @@ class Captcha9kw(Hook): sleep(10) - for opt in hoster_options: + for opt in self.getConfig("hoster_options").split('|'): + details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -234,8 +234,8 @@ class Captcha9kw(Hook): def captchaCorrect(self, task): - self._captchaResponse(self, task, True) + self._captchaResponse(task, True) def captchaInvalid(self, task): - self._captchaResponse(self, task, False) + self._captchaResponse(task, False) -- cgit v1.2.3 From ed52ca7df9dbd4d8b9538219bd76d2cc603e8bf1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 12 Nov 2014 01:29:53 +0100 Subject: [Captcha9kw] Code improvements --- module/plugins/hooks/Captcha9kw.py | 119 +++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 63 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index cc56ad4a2..bdccf2f76 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,14 +17,14 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.18" + __version__ = "0.19" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), ("confirm", "bool", "Confirm Captcha (cost +6 credits)", False), ("captchaperhour", "int", "Captcha per hour", "9999"), - ("prio", "int", "Priority (max 20)(cost +0 -> +20 credits)", "0"), - ("queue", "int", "Max. Queue (max 999)", "0"), + ("prio", "int", "Priority (max 10)(cost +0 -> +10 credits)", "0"), + ("queue", "int", "Max. Queue (max 999)", "50"), ("hoster_options", "string", "Hoster options (format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900|...)", "ShareonlineBiz:prio=0:timeout=999 | UploadedTo:prio=0:timeout=999"), ("selfsolve", "bool", "Selfsolve (manually solve your captcha in your 9kw client if active)", "0"), ("passkey", "password", "API key", ""), @@ -63,6 +63,7 @@ class Captcha9kw(Hook): try: with open(task.captchaFile, 'rb') as f: data = f.read() + except IOError, e: self.logError(e) return @@ -79,7 +80,7 @@ class Captcha9kw(Hook): 'numeric' : 0, 'case_sensitive': 0, 'math' : 0, - 'prio' : self.getConfig("prio"), + 'prio' : min(max(self.getConfig("prio"), 0), 10), 'confirm' : self.getConfig("confirm"), 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), 'selfsolve' : self.getConfig("selfsolve"), @@ -95,41 +96,44 @@ class Captcha9kw(Hook): for d in details: hosteroption = d.split("=") - if len(hosteroption) <= 1 or not hosteroption[1].isdigit(): + if len(hosteroption) < 2 or not hosteroption[1].isdigit(): continue o = hosteroption[0].lower() if o in option: option[o] = hosteroption[1] + break + + post_data = {'apikey' : self.getConfig("passkey"), + 'prio' : option['prio'], + 'confirm' : option['confirm'], + 'maxtimeout' : option['timeout'], + 'selfsolve' : option['selfsolve'], + 'captchaperhour': option['cph'], + 'case-sensitive': option['case_sensitive'], + 'min_len' : option['min'], + 'max_len' : option['max'], + 'phrase' : option['phrase'], + 'numeric' : option['numeric'], + 'math' : option['math'], + 'oldsource' : pluginname, + 'pyload' : "1", + 'source' : "pyload", + 'base64' : "1", + 'mouse' : mouse, + 'file-upload-01': data, + 'action' : "usercaptchaupload"} + for _ in xrange(5): - post_data = {'apikey' : self.getConfig("passkey"), - 'prio' : option['prio'], - 'confirm' : option['confirm'], - 'maxtimeout' : option['timeout'], - 'selfsolve' : option['selfsolve'], - 'captchaperhour': option['cph'], - 'case-sensitive': option['case_sensitive'], - 'min_len' : option['min'], - 'max_len' : option['max'], - 'phrase' : option['phrase'], - 'numeric' : option['numeric'], - 'math' : option['math'], - 'oldsource' : pluginname, - 'pyload' : "1", - 'source' : "pyload", - 'base64' : "1", - 'mouse' : mouse, - 'file-upload-01': data, - 'action' : "usercaptchaupload"} try: res = getURL(self.API_URL, post=post_data) - if res: - break except BadHeader, e: sleep(3) - - if not res.isdigit(): + else: + if res and res.isdigit(): + break + else: self.logError(_("Bad upload: %s") % res) return @@ -138,55 +142,39 @@ class Captcha9kw(Hook): task.data["ticket"] = res self.logInfo("result %s : %s" % (res, result)) - for _ in xrange(int(self.getConfig("timeout") / 5)): - res2 = getURL(self.API_URL, - get={'apikey': self.getConfig("passkey"), - 'id' : res, - 'pyload': "1", - 'info' : "1", - 'source': "pyload", - 'action': "usercaptchacorrectdata"}) - - if not res2 or res2 == "NO DATA": - sleep(5) - else: - break - - task.setResult(res2 or None) + task.setResult(self._captchaResponse(task)) def newCaptchaTask(self, task): if not task.isTextual() and not task.isPositional(): return - elif not self.getConfig("passkey"): + if not self.getConfig("passkey"): return - elif self.core.isClientConnected() and not self.getConfig("force"): + if self.core.isClientConnected() and not self.getConfig("force"): return credits = self.getCredits() if not credits: - self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) + self.logError(_("Your captcha 9kw.eu account has not enough credits")) return - queue = self.getConfig("queue") + queue = min(self.getConfig("queue"), 999) timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - if 1000 > queue > 10: + for _ in xrange(5): servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") - regex = re.compile("queue=(\d+)") - - for _ in xrange(3): - if queue < regex.search(servercheck).group(1): - break + if queue < re.search(r'queue=(\d+)', servercheck).group(1): + break - sleep(10) + sleep(10) + else: + self.fail(_("Too many captchas in queue")) for opt in self.getConfig("hoster_options").split('|'): - details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -200,16 +188,18 @@ class Captcha9kw(Hook): and hosteroption[1].isdigit()): timeout = int(hosteroption[1]) + break + task.handler.append(self) task.setWaiting(timeout) - start_new_thread(self._processCaptcha, (task,)) + self._processCaptcha(task) - def _captchaResponse(self, task, correct): + def _captchaResponse(self, task, correct=True): if "ticket" not in task.data: - self.logDebug(_("No CaptchaID for %s request (task: %s)" % type) % task) + self.logDebug("No CaptchaID for %s request (task: %s)" % type % task) return type = "correct" if correct else "refund" @@ -225,12 +215,15 @@ class Captcha9kw(Hook): 'source' : "pyload", 'id' : task.data["ticket"]}) - if res is "OK": - self.logInfo(_("Request %s: %s" % type) % res) - return + self.logDebug("Request %s: %s" % type % res) + + if not res or res is "NO DATA": + self.logDebug("Could not send %s request: %s" % type % res) + sleep(5) else: - self.logDebug(_("Could not send %s request: %s" % type) % res) - sleep(1) + return res + else: + return None def captchaCorrect(self, task): -- cgit v1.2.3 From 7699d4b88c6245bd31d94ff0b5954cdd7c08ca73 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 12 Nov 2014 01:55:00 +0100 Subject: [Captcha9kw] Fix str.strip --- 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 bdccf2f76..ff604080d 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -88,7 +88,7 @@ class Captcha9kw(Hook): for opt in self.getConfig("hoster_options").split('|'): - details = map(strip(), opt.split(':')) + details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): continue @@ -175,7 +175,7 @@ class Captcha9kw(Hook): self.fail(_("Too many captchas in queue")) for opt in self.getConfig("hoster_options").split('|'): - details = map(strip(), opt.split(':')) + details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): continue -- cgit v1.2.3 From 9084b84b92b4e1a23d599872356d4a67c2c2b980 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 12 Nov 2014 02:25:05 +0100 Subject: [Captcha9kw] Fix str.strip 2 --- 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 ff604080d..327878ab7 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -86,7 +86,7 @@ class Captcha9kw(Hook): 'selfsolve' : self.getConfig("selfsolve"), 'cph' : self.getConfig("captchaperhour")} - for opt in self.getConfig("hoster_options").split('|'): + for opt in str(self.getConfig("hoster_options").split('|')): details = map(str.strip, opt.split(':')) @@ -174,7 +174,7 @@ class Captcha9kw(Hook): else: self.fail(_("Too many captchas in queue")) - for opt in self.getConfig("hoster_options").split('|'): + for opt in str(self.getConfig("hoster_options").split('|')): details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): -- cgit v1.2.3 From ef40c9a735946e5ecba2d18d6ee1ad23a149f9b6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 12 Nov 2014 14:24:11 +0100 Subject: [Captcha9kw] Fix some stuff (thx stefanos) --- module/plugins/hooks/Captcha9kw.py | 48 +++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 14 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 327878ab7..2ea0aeb72 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.21" + __version__ = "0.22" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -82,7 +82,7 @@ class Captcha9kw(Hook): 'math' : 0, 'prio' : min(max(self.getConfig("prio"), 0), 10), 'confirm' : self.getConfig("confirm"), - 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), + 'timeout' : min(max(self.getConfig("timeout"), 300), 3999), 'selfsolve' : self.getConfig("selfsolve"), 'cph' : self.getConfig("captchaperhour")} @@ -140,9 +140,27 @@ class Captcha9kw(Hook): self.logInfo(_("NewCaptchaID from upload: %s : %s") % (res, task.captchaFile)) task.data["ticket"] = res - self.logInfo("result %s : %s" % (res, result)) - task.setResult(self._captchaResponse(task)) + for _ in xrange(int(self.getConfig("timeout") / 5)): + result = getURL(self.API_URL, + get={'apikey': self.getConfig("passkey"), + 'id' : res, + 'pyload': "1", + 'info' : "1", + 'source': "pyload", + 'action': "usercaptchacorrectdata"}) + + if not result or result == "NO DATA": + sleep(5) + else: + break + else: + self.logDebug("Could not send request: %s" % res) + result = None + + self.logInfo(_("Result: %s : %s") % (res, result)) + + task.setResult(result) def newCaptchaTask(self, task): @@ -162,7 +180,7 @@ class Captcha9kw(Hook): return queue = min(self.getConfig("queue"), 999) - timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) + timeout = min(max(self.getConfig("timeout"), 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) for _ in xrange(5): @@ -197,12 +215,13 @@ class Captcha9kw(Hook): self._processCaptcha(task) - def _captchaResponse(self, task, correct=True): - if "ticket" not in task.data: - self.logDebug("No CaptchaID for %s request (task: %s)" % type % task) + def _captchaResponse(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)) return - type = "correct" if correct else "refund" passkey = self.getConfig("passkey") for _ in xrange(3): @@ -215,13 +234,14 @@ class Captcha9kw(Hook): 'source' : "pyload", 'id' : task.data["ticket"]}) - self.logDebug("Request %s: %s" % type % res) + self.logDebug("Request %s: %s" % (type, res)) - if not res or res is "NO DATA": - self.logDebug("Could not send %s request: %s" % type % res) - sleep(5) + if res is "OK": + self.logInfo(_("Request %s: %s" % type) % res) + return else: - return res + self.logDebug("Could not send %s request: %s" % (type, res)) + sleep(5) else: return None -- cgit v1.2.3 From add077c49cc722ba277de941df0d1544db57df32 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 12 Nov 2014 16:04:47 +0100 Subject: [Captcha9kw] Fix typo --- module/plugins/hooks/Captcha9kw.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 2ea0aeb72..a6ec18475 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.22" + __version__ = "0.23" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -125,7 +125,7 @@ class Captcha9kw(Hook): 'file-upload-01': data, 'action' : "usercaptchaupload"} - for _ in xrange(5): + for _i in xrange(5): try: res = getURL(self.API_URL, post=post_data) except BadHeader, e: @@ -141,7 +141,7 @@ class Captcha9kw(Hook): task.data["ticket"] = res - for _ in xrange(int(self.getConfig("timeout") / 5)): + for _i in xrange(int(self.getConfig("timeout") / 5)): result = getURL(self.API_URL, get={'apikey': self.getConfig("passkey"), 'id' : res, @@ -183,7 +183,7 @@ class Captcha9kw(Hook): timeout = min(max(self.getConfig("timeout"), 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - for _ in xrange(5): + for _i in xrange(5): servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") if queue < re.search(r'queue=(\d+)', servercheck).group(1): break @@ -224,7 +224,7 @@ class Captcha9kw(Hook): passkey = self.getConfig("passkey") - for _ in xrange(3): + for _i in xrange(3): res = getURL(self.API_URL, get={'action' : "usercaptchacorrectback", 'apikey' : passkey, -- cgit v1.2.3 From 0f86cba679c796f35c9e3fa27c00e011ffd9bc92 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 12 Nov 2014 16:50:36 +0100 Subject: [Captcha9kw] Restore https feature + code cosmetics --- module/plugins/hooks/Captcha9kw.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index a6ec18475..77375fb8b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,9 +17,10 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.23" + __version__ = "0.24" __config__ = [("activated", "bool", "Activated", True), + ("ssl", "bool", "Use HTTPS", True), ("force", "bool", "Force captcha resolving even if client is connected", True), ("confirm", "bool", "Confirm Captcha (cost +6 credits)", False), ("captchaperhour", "int", "Captcha per hour", "9999"), @@ -41,6 +42,8 @@ class Captcha9kw(Hook): 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): @@ -72,8 +75,6 @@ class Captcha9kw(Hook): mouse = 1 if task.isPositional() else 0 pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - self.logDebug("%s: %s" % (task.captchaFile, data)) - option = {'min' : 2, 'max' : 50, 'phrase' : 0, @@ -137,7 +138,7 @@ class Captcha9kw(Hook): self.logError(_("Bad upload: %s") % res) return - self.logInfo(_("NewCaptchaID from upload: %s : %s") % (res, task.captchaFile)) + self.logDebug(_("NewCaptchaID ticket: %s") % res, task.captchaFile) task.data["ticket"] = res @@ -158,7 +159,7 @@ class Captcha9kw(Hook): self.logDebug("Could not send request: %s" % res) result = None - self.logInfo(_("Result: %s : %s") % (res, result)) + self.logInfo(_("Captcha result for ticket %s: %s") % (res, result)) task.setResult(result) @@ -236,14 +237,12 @@ class Captcha9kw(Hook): self.logDebug("Request %s: %s" % (type, res)) - if res is "OK": - self.logInfo(_("Request %s: %s" % type) % res) - return - else: - self.logDebug("Could not send %s request: %s" % (type, res)) - sleep(5) + if res == "OK": + break + + sleep(5) else: - return None + self.logDebug("Could not send %s request: %s" % (type, res)) def captchaCorrect(self, task): -- cgit v1.2.3 From b71a408f118eb1117dad3c11da8bfd883e6bf28f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 28 Nov 2014 23:56:31 +0100 Subject: [Captcha9kw] Option "Captcha per minute" (thx stefanos) --- module/plugins/hooks/Captcha9kw.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 77375fb8b..38b39b2af 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,19 +17,20 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.24" - - __config__ = [("activated", "bool", "Activated", True), - ("ssl", "bool", "Use HTTPS", True), - ("force", "bool", "Force captcha resolving even if client is connected", True), - ("confirm", "bool", "Confirm Captcha (cost +6 credits)", False), - ("captchaperhour", "int", "Captcha per hour", "9999"), - ("prio", "int", "Priority (max 10)(cost +0 -> +10 credits)", "0"), - ("queue", "int", "Max. Queue (max 999)", "50"), - ("hoster_options", "string", "Hoster options (format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900|...)", "ShareonlineBiz:prio=0:timeout=999 | UploadedTo:prio=0:timeout=999"), - ("selfsolve", "bool", "Selfsolve (manually solve your captcha in your 9kw client if active)", "0"), - ("passkey", "password", "API key", ""), - ("timeout", "int", "Timeout in seconds (min 60, max 3999)", "900")] + __version__ = "0.25" + + __config__ = [("activated" , "bool" , "Activated" , True ), + ("ssl" , "bool" , "Use HTTPS" , True ), + ("force" , "bool" , "Force captcha resolving even 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" ), + ("prio" , "int" , "Priority (max 10)(cost +0 -> +10 credits)" , "0" ), + ("queue" , "int" , "Max. Queue (max 999)" , "50" ), + ("hoster_options", "string" , "Hoster options (format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900|...)", "ShareonlineBiz:prio=0:timeout=999 | UploadedTo:prio=0:timeout=999"), + ("selfsolve" , "bool" , "Selfsolve (manually solve your captcha in your 9kw client if active)" , "0" ), + ("passkey" , "password", "API key" , "" ), + ("timeout" , "int" , "Timeout in seconds (min 60, max 3999)" , "900" )] __description__ = """Send captchas to 9kw.eu""" __license__ = "GPLv3" @@ -85,7 +86,8 @@ class Captcha9kw(Hook): 'confirm' : self.getConfig("confirm"), 'timeout' : min(max(self.getConfig("timeout"), 300), 3999), 'selfsolve' : self.getConfig("selfsolve"), - 'cph' : self.getConfig("captchaperhour")} + 'cph' : self.getConfig("captchaperhour"), + 'cpm' : self.getConfig("captchapermin")} for opt in str(self.getConfig("hoster_options").split('|')): @@ -112,6 +114,7 @@ class Captcha9kw(Hook): 'maxtimeout' : option['timeout'], 'selfsolve' : option['selfsolve'], 'captchaperhour': option['cph'], + 'captchapermin' : option['cpm'], 'case-sensitive': option['case_sensitive'], 'min_len' : option['min'], 'max_len' : option['max'], -- cgit v1.2.3 From 86d3b6249073947132ed3a9eeb1b1e987d19569a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Dec 2014 18:17:13 +0100 Subject: Update some plugins --- 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 38b39b2af..ead8aec9a 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -56,7 +56,7 @@ class Captcha9kw(Hook): if res.isdigit(): self.logInfo(_("%s credits left") % res) - credits = self.info["credits"] = int(res) + credits = self.info['credits'] = int(res) return credits else: self.logError(res) -- cgit v1.2.3 From e4c9e4ffc9e3f6bd6b16ce83796dc3d275d544f7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 01:13:05 +0100 Subject: Don't start unused periodical in some addons --- module/plugins/hooks/Captcha9kw.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index ead8aec9a..33ad00c49 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.25" + __version__ = "0.26" __config__ = [("activated" , "bool" , "Activated" , True ), ("ssl" , "bool" , "Use HTTPS" , True ), @@ -41,6 +41,11 @@ class Captcha9kw(Hook): API_URL = "http://www.9kw.eu/index.cgi" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 if self.getConfig("ssl"): -- cgit v1.2.3