summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/BypassCaptcha.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/BypassCaptcha.py')
-rw-r--r--module/plugins/hooks/BypassCaptcha.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
index 581d2f6dd..bc34f1239 100644
--- a/module/plugins/hooks/BypassCaptcha.py
+++ b/module/plugins/hooks/BypassCaptcha.py
@@ -4,7 +4,8 @@ import pycurl
from module.network.HTTPRequest import BadHeader
from module.network.RequestFactory import getRequest as get_request
-from module.plugins.internal.Addon import Addon, threaded
+from module.plugins.internal.Addon import Addon
+from module.plugins.internal.misc import threaded
class BypassCaptchaException(Exception):
@@ -28,7 +29,7 @@ class BypassCaptchaException(Exception):
class BypassCaptcha(Addon):
__name__ = "BypassCaptcha"
__type__ = "hook"
- __version__ = "0.09"
+ __version__ = "0.10"
__status__ = "testing"
__config__ = [("activated" , "bool" , "Activated" , False),
@@ -50,7 +51,7 @@ class BypassCaptcha(Addon):
def get_credits(self):
- res = self.load(self.GETCREDITS_URL, post={'key': self.get_config('passkey')})
+ res = self.load(self.GETCREDITS_URL, post={'key': self.config.get('passkey')})
data = dict(x.split(' ', 1) for x in res.splitlines())
return int(data['Left'])
@@ -65,7 +66,7 @@ class BypassCaptcha(Addon):
try:
res = self.load(self.SUBMIT_URL,
post={'vendor_key': self.PYLOAD_KEY,
- 'key': self.get_config('passkey'),
+ 'key': self.config.get('passkey'),
'gen_task_id': "1",
'file': (pycurl.FORM_FILE, captcha)},
req=req)
@@ -85,7 +86,7 @@ class BypassCaptcha(Addon):
def respond(self, ticket, success):
try:
- res = self.load(self.RESPOND_URL, post={'task_id': ticket, 'key': self.get_config('passkey'),
+ res = self.load(self.RESPOND_URL, post={'task_id': ticket, 'key': self.config.get('passkey'),
'cv': 1 if success else 0})
except BadHeader, e:
self.log_error(_("Could not send response"), e)
@@ -98,10 +99,10 @@ class BypassCaptcha(Addon):
if not task.isTextual():
return False
- if not self.get_config('passkey'):
+ if not self.config.get('passkey'):
return False
- if self.pyload.isClientConnected() and self.get_config('check_client'):
+ if self.pyload.isClientConnected() and self.config.get('check_client'):
return False
if self.get_credits() > 0:
@@ -125,7 +126,7 @@ class BypassCaptcha(Addon):
@threaded
- def _process_captcha(self, task):
+ def _process_captcha(self, task)
c = task.captchaFile
try:
ticket, result = self.submit(c)