summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/CaptchaBrotherhood.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/CaptchaBrotherhood.py
parentSpare code cosmetics (3) (diff)
downloadpyload-e4fb45b22d36595839e8f638a3f0a4669dba3e8d.tar.xz
Spare code cosmetics (4)
Diffstat (limited to 'module/plugins/hooks/CaptchaBrotherhood.py')
-rw-r--r--module/plugins/hooks/CaptchaBrotherhood.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py
index 3992c6ca7..070d92da8 100644
--- a/module/plugins/hooks/CaptchaBrotherhood.py
+++ b/module/plugins/hooks/CaptchaBrotherhood.py
@@ -39,9 +39,9 @@ class CaptchaBrotherhood(Hook):
__type__ = "hook"
__version__ = "0.09"
- __config__ = [("username", "str", "Username", ""),
- ("force", "bool", "Force CT even if client is connected", False),
- ("passkey", "password", "Password", "")]
+ __config__ = [("username" , "str" , "Username" , "" ),
+ ("password" , "password", "Password" , "" ),
+ ("check_client", "bool" , "Don't use if client is connected", True)]
__description__ = """Send captchas to CaptchaBrotherhood.com"""
__license__ = "GPLv3"
@@ -60,7 +60,7 @@ class CaptchaBrotherhood(Hook):
def getCredits(self):
res = self.load(self.API_URL + "askCredits.aspx",
- get={"username": self.getConfig('username'), "password": self.getConfig('passkey')})
+ get={"username": self.getConfig('username'), "password": self.getConfig('password')})
if not res.startswith("OK"):
raise CaptchaBrotherhoodException(res)
else:
@@ -90,7 +90,7 @@ class CaptchaBrotherhood(Hook):
url = "%ssendNewCaptcha.aspx?%s" % (self.API_URL,
urllib.urlencode({'username' : self.getConfig('username'),
- 'password' : self.getConfig('passkey'),
+ 'password' : self.getConfig('password'),
'captchaSource': "pyLoad",
'timeout' : "80"}))
@@ -124,7 +124,7 @@ class CaptchaBrotherhood(Hook):
def api_response(self, api, ticket):
res = self.load("%s%s.aspx" % (self.API_URL, api),
get={"username": self.getConfig('username'),
- "password": self.getConfig('passkey'),
+ "password": self.getConfig('password'),
"captchaID": ticket})
if not res.startswith("OK"):
raise CaptchaBrotherhoodException("Unknown response: %s" % res)
@@ -139,10 +139,10 @@ class CaptchaBrotherhood(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() > 10: