summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/ImageTyperz.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-06-21 08:50:26 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-06-24 22:43:08 +0200
commite4fb45b22d36595839e8f638a3f0a4669dba3e8d (patch)
tree549ba2a4f6e23a7178b8f91c79e0c037b36412ca /module/plugins/hooks/ImageTyperz.py
parentSpare code cosmetics (3) (diff)
downloadpyload-e4fb45b22d36595839e8f638a3f0a4669dba3e8d.tar.xz
Spare code cosmetics (4)
Diffstat (limited to 'module/plugins/hooks/ImageTyperz.py')
-rw-r--r--module/plugins/hooks/ImageTyperz.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py
index 15097fd5a..90849a20c 100644
--- a/module/plugins/hooks/ImageTyperz.py
+++ b/module/plugins/hooks/ImageTyperz.py
@@ -34,9 +34,9 @@ class ImageTyperz(Hook):
__type__ = "hook"
__version__ = "0.07"
- __config__ = [("username", "str", "Username", ""),
- ("passkey", "password", "Password", ""),
- ("force", "bool", "Force IT even if client is connected", False)]
+ __config__ = [("username" , "str" , "Username" , "" ),
+ ("password" , "password", "Password" , "" ),
+ ("check_client", "bool" , "Don't use if client is connected", True)]
__description__ = """Send captchas to ImageTyperz.com"""
__license__ = "GPLv3"
@@ -59,7 +59,7 @@ class ImageTyperz(Hook):
res = self.load(self.GETCREDITS_URL,
post={'action': "REQUESTBALANCE",
'username': self.getConfig('username'),
- 'password': self.getConfig('passkey')})
+ 'password': self.getConfig('password')})
if res.startswith('ERROR'):
raise ImageTyperzException(res)
@@ -80,7 +80,7 @@ class ImageTyperz(Hook):
try:
#@NOTE: Workaround multipart-post bug in HTTPRequest.py
- if re.match("^\w*$", self.getConfig('passkey')):
+ if re.match("^\w*$", self.getConfig('password')):
multipart = True
data = (pycurl.FORM_FILE, captcha)
else:
@@ -92,7 +92,7 @@ class ImageTyperz(Hook):
res = self.load(self.SUBMIT_URL,
post={'action': "UPLOADCAPTCHA",
'username': self.getConfig('username'),
- 'password': self.getConfig('passkey'), "file": data},
+ 'password': self.getConfig('password'), "file": data},
multipart=multipart,
req=req)
finally:
@@ -117,10 +117,10 @@ class ImageTyperz(Hook):
if not task.isTextual():
return False
- if not self.getConfig('username') or not self.getConfig('passkey'):
+ if not self.getConfig('username') or not self.getConfig('password'):
return False
- if self.core.isClientConnected() and not self.getConfig('force'):
+ if self.core.isClientConnected() and self.getConfig('check_client'):
return False
if self.getCredits() > 0:
@@ -138,7 +138,7 @@ class ImageTyperz(Hook):
res = self.load(self.RESPOND_URL,
post={'action': "SETBADIMAGE",
'username': self.getConfig('username'),
- 'password': self.getConfig('passkey'),
+ 'password': self.getConfig('password'),
'imageid': task.data['ticket']})
if res == "SUCCESS":