From cc967b40cae1b7a4a7dd40036fecf5d5dfdc43d3 Mon Sep 17 00:00:00 2001 From: stefanos Date: Wed, 12 Jun 2013 18:18:47 +0300 Subject: Update Captcha9kw.py option for timeout, answercheck every 3 seconds is enough and hints for prio/confirm --- module/plugins/hooks/Captcha9kw.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index f7226fc59..25ca3b05f 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -30,14 +30,15 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" - __version__ = "0.05" + __version__ = "0.06" __description__ = """send captchas to 9kw.eu""" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), ("https", "bool", "Enable HTTPS", "False"), - ("confirm", "bool", "Confirm Captcha", "False"), - ("captchaperhour", "int", "Captcha per hour", "9999"), - ("prio", "int", "Prio (1-10)", "0"), + ("confirm", "bool", "Confirm Captcha (Cost +6)", "False"), + ("captchaperhour", "int", "Captcha per hour (max. 9999)", "9999"), + ("prio", "int", "Prio 1-10 (Cost +1-10)", "0"), + ("timeout", "int", "Timeout (max. 300)", "220"), ("passkey", "password", "API key", ""),] __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") @@ -76,7 +77,7 @@ class Captcha9kw(Hook): "prio": self.getConfig("prio"), "confirm": self.getConfig("confirm"), "captchaperhour": self.getConfig("captchaperhour"), - "maxtimeout": "220", + "maxtimeout": self.timeout, "pyload": "1", "source": "pyload", "base64": "1", @@ -87,13 +88,13 @@ class Captcha9kw(Hook): if response.isdigit(): self.logInfo(_("NewCaptchaID from upload: %s : %s" % (response,task.captchaFile))) - for i in range(1, 220, 1): + for i in range(1, 100, 1): response2 = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "id": response,"pyload": "1","source": "pyload", "action": "usercaptchacorrectdata" }) if(response2 != ""): break; - time.sleep(1) + time.sleep(3) result = response2 task.data["ticket"] = response @@ -115,7 +116,7 @@ class Captcha9kw(Hook): if self.getCredits() > 0: task.handler.append(self) - task.setWaiting(220) + task.setWaiting(self.timeout) start_new_thread(self.processCaptcha, (task,)) else: -- cgit v1.2.3 From 845918643751ec7a16c4fd00c50bbd6d315177df Mon Sep 17 00:00:00 2001 From: stefanos Date: Wed, 12 Jun 2013 22:52:27 +0200 Subject: Update Captcha9kw.py corrected self.timeout to self.getConfig("timeout") --- module/plugins/hooks/Captcha9kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 25ca3b05f..755e2519a 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -77,7 +77,7 @@ class Captcha9kw(Hook): "prio": self.getConfig("prio"), "confirm": self.getConfig("confirm"), "captchaperhour": self.getConfig("captchaperhour"), - "maxtimeout": self.timeout, + "maxtimeout": self.getConfig("timeout"), "pyload": "1", "source": "pyload", "base64": "1", @@ -116,7 +116,7 @@ class Captcha9kw(Hook): if self.getCredits() > 0: task.handler.append(self) - task.setWaiting(self.timeout) + task.setWaiting(self.getConfig("timeout")) start_new_thread(self.processCaptcha, (task,)) else: -- cgit v1.2.3