From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/hooks/BypassCaptcha.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 9e01edfa2..e2abf617c 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -4,7 +4,7 @@ import pycurl from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded class BypassCaptchaException(Exception): @@ -28,7 +28,7 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" - __version__ = "0.06" + __version__ = "0.07" __config__ = [("force", "bool", "Force BC even if client is connected", False), ("passkey", "password", "Passkey", "")] -- cgit v1.2.3 From f4b893e5ee24769584a2da1866c665489f7019ec Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 06:56:13 +0200 Subject: Hook plugin code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index e2abf617c..4b50ef800 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -95,7 +95,7 @@ class BypassCaptcha(Hook): self.logError(_("Could not send response"), e) - def newCaptchaTask(self, task): + def captcha_task(self, task): if "service" in task.data: return False -- cgit v1.2.3 From 5a139055ae658d3a05cbb658cbd66aeae0d01db5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 21:06:10 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 4b50ef800..bbbe96b73 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -118,12 +118,12 @@ class BypassCaptcha(Hook): self.logInfo(_("Your %s account has not enough credits") % self.__name__) - def captchaCorrect(self, task): + def captcha_correct(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], True) - def captchaInvalid(self, task): + def captcha_invalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], False) -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/hooks/BypassCaptcha.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index bbbe96b73..1651ea067 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -3,7 +3,7 @@ import pycurl from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL, getRequest +from module.network.RequestFactory import getRequest from module.plugins.internal.Hook import Hook, threaded @@ -54,7 +54,7 @@ class BypassCaptcha(Hook): def getCredits(self): - res = getURL(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')}) + res = self.load(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')}) data = dict(x.split(' ', 1) for x in res.splitlines()) return int(data['Left']) @@ -67,12 +67,12 @@ class BypassCaptcha(Hook): req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: - res = req.load(self.SUBMIT_URL, - post={'vendor_key': self.PYLOAD_KEY, - 'key': self.getConfig('passkey'), - 'gen_task_id': "1", - 'file': (pycurl.FORM_FILE, captcha)}, - multipart=True) + res = self.load(self.SUBMIT_URL, + post={'vendor_key': self.PYLOAD_KEY, + 'key': self.getConfig('passkey'), + 'gen_task_id': "1", + 'file': (pycurl.FORM_FILE, captcha)}, + req=req) finally: req.close() @@ -89,7 +89,7 @@ class BypassCaptcha(Hook): def respond(self, ticket, success): try: - res = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'), + res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'), "cv": 1 if success else 0}) except BadHeader, e: self.logError(_("Could not send response"), e) -- cgit v1.2.3 From e4fb45b22d36595839e8f638a3f0a4669dba3e8d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 21 Jun 2015 08:50:26 +0200 Subject: Spare code cosmetics (4) --- module/plugins/hooks/BypassCaptcha.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 1651ea067..4869288c9 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -30,8 +30,8 @@ class BypassCaptcha(Hook): __type__ = "hook" __version__ = "0.07" - __config__ = [("force", "bool", "Force BC even if client is connected", False), - ("passkey", "password", "Passkey", "")] + __config__ = [("passkey" , "password", "Access key" , "" ), + ("check_client", "bool" , "Don't use if client is connected", True)] __description__ = """Send captchas to BypassCaptcha.com""" __license__ = "GPLv3" @@ -105,7 +105,7 @@ class BypassCaptcha(Hook): if not self.getConfig('passkey'): 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: -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hooks/BypassCaptcha.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 4869288c9..cb91c06ce 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -13,7 +13,7 @@ class BypassCaptchaException(Exception): self.err = err - def getCode(self): + def get_code(self): return self.err @@ -28,7 +28,7 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] @@ -53,8 +53,8 @@ class BypassCaptcha(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def getCredits(self): - res = self.load(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')}) + def get_credits(self): + res = self.load(self.GETCREDITS_URL, post={"key": self.get_config('passkey')}) data = dict(x.split(' ', 1) for x in res.splitlines()) return int(data['Left']) @@ -63,13 +63,13 @@ class BypassCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): req = getRequest() - #raise timeout threshold + # raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: res = self.load(self.SUBMIT_URL, post={'vendor_key': self.PYLOAD_KEY, - 'key': self.getConfig('passkey'), + 'key': self.get_config('passkey'), 'gen_task_id': "1", 'file': (pycurl.FORM_FILE, captcha)}, req=req) @@ -82,17 +82,17 @@ class BypassCaptcha(Hook): result = data['Value'] ticket = data['TaskId'] - self.logDebug("Result %s : %s" % (ticket, result)) + self.log_debug("Result %s : %s" % (ticket, result)) return ticket, result def respond(self, ticket, success): try: - res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'), + res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.get_config('passkey'), "cv": 1 if success else 0}) except BadHeader, e: - self.logError(_("Could not send response"), e) + self.log_error(_("Could not send response"), e) def captcha_task(self, task): @@ -102,20 +102,20 @@ class BypassCaptcha(Hook): if not task.isTextual(): return False - if not self.getConfig('passkey'): + if not self.get_config('passkey'): return False - if self.core.isClientConnected() and self.getConfig('check_client'): + if self.core.isClientConnected() and self.get_config('check_client'): return False - if self.getCredits() > 0: + if self.get_credits() > 0: task.handler.append(self) task.data['service'] = self.__name__ task.setWaiting(100) - self._processCaptcha(task) + self._process_captcha(task) else: - self.logInfo(_("Your %s account has not enough credits") % self.__name__) + self.log_info(_("Your %s account has not enough credits") % self.__name__) def captcha_correct(self, task): @@ -129,7 +129,7 @@ class BypassCaptcha(Hook): @threaded - def _processCaptcha(self, task): + def _process_captcha(self, task): c = task.captchaFile try: ticket, result = self.submit(c) -- cgit v1.2.3 From 9e5d813d7721e351ac02ba72bdc473a7d77ba6b7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Jul 2015 20:04:36 +0200 Subject: Code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index cb91c06ce..ab08c68c1 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -3,7 +3,7 @@ import pycurl from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getRequest +from module.network.RequestFactory import getRequest as get_request from module.plugins.internal.Hook import Hook, threaded @@ -61,7 +61,7 @@ class BypassCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): - req = getRequest() + req = get_request() # raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/hooks/BypassCaptcha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index ab08c68c1..42c30ba25 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -63,7 +63,7 @@ class BypassCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): req = get_request() - # raise timeout threshold + #: Raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: -- cgit v1.2.3 From 502517f37c7540b0bddb092e69386d9d6f08800c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 09:42:34 +0200 Subject: Fix addons --- module/plugins/hooks/BypassCaptcha.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 42c30ba25..2607ac5ad 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -40,8 +40,6 @@ class BypassCaptcha(Hook): ("zoidberg" , "zoidberg@mujmail.cz" )] - interval = 0 #@TODO: Remove in 0.4.10 - PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" SUBMIT_URL = "http://bypasscaptcha.com/upload.php" @@ -49,10 +47,6 @@ class BypassCaptcha(Hook): GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def get_credits(self): res = self.load(self.GETCREDITS_URL, post={"key": self.get_config('passkey')}) -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/hooks/BypassCaptcha.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 2607ac5ad..8a47da5bd 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -48,7 +48,7 @@ class BypassCaptcha(Hook): 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.get_config('passkey')}) data = dict(x.split(' ', 1) for x in res.splitlines()) return int(data['Left']) @@ -83,8 +83,8 @@ class BypassCaptcha(Hook): def respond(self, ticket, success): try: - res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.get_config('passkey'), - "cv": 1 if success else 0}) + res = self.load(self.RESPOND_URL, post={'task_id': ticket, 'key': self.get_config('passkey'), + 'cv': 1 if success else 0}) except BadHeader, e: self.log_error(_("Could not send response"), e) -- cgit v1.2.3 From 56389e28ba5d2f5658278bc7f486d73be747f135 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 11:44:49 +0200 Subject: Rename self.core to self.pyload (plugins only) --- module/plugins/hooks/BypassCaptcha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 8a47da5bd..2ef3033c4 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -99,7 +99,7 @@ class BypassCaptcha(Hook): if not self.get_config('passkey'): return False - if self.core.isClientConnected() and self.get_config('check_client'): + if self.pyload.isClientConnected() and self.get_config('check_client'): return False if self.get_credits() > 0: -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hooks/BypassCaptcha.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 2ef3033c4..c954c5633 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -29,6 +29,7 @@ class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" __version__ = "0.08" + __status__ = "stable" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hooks/BypassCaptcha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index c954c5633..578586ae5 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -29,7 +29,7 @@ class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" __version__ = "0.08" - __status__ = "stable" + __status__ = "testing" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] -- cgit v1.2.3 From 761ca5c66e07559925ebbdbc6531f9ca658b12ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 16:11:58 +0200 Subject: Code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 578586ae5..a89d1c23f 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -114,12 +114,12 @@ class BypassCaptcha(Hook): def captcha_correct(self, task): - if task.data['service'] == self.__name__ and "ticket" in task.data: + if task.data['service'] is self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], True) def captcha_invalid(self, task): - if task.data['service'] == self.__name__ and "ticket" in task.data: + if task.data['service'] is self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], False) -- cgit v1.2.3 From 88f98ab3bd6e091c1b6ca6ac9fddc37b2e29694c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Jul 2015 14:37:44 +0200 Subject: Fix get_code call in captcha hooks --- module/plugins/hooks/BypassCaptcha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index a89d1c23f..4b155a67e 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -129,7 +129,7 @@ class BypassCaptcha(Hook): try: ticket, result = self.submit(c) except BypassCaptchaException, e: - task.error = e.getCode() + task.error = e.get_code() return task.data['ticket'] = ticket -- cgit v1.2.3