From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hooks/BypassCaptcha.py | 8 +++++--- 1 file changed, 5 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 70e60f56c..1c9c4e722 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: RaNaN, Godofdream, zoidberg """ from thread import start_new_thread @@ -45,10 +43,13 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __version__ = "0.04" - __description__ = """Send captchas to BypassCaptcha.com""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force BC even if client is connected", False), ("passkey", "password", "Passkey", "")] + + __description__ = """Send captchas to BypassCaptcha.com""" __author_name__ = ("RaNaN", "Godofdream", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "soilfcition@gmail.com", "zoidberg@mujmail.cz") @@ -56,6 +57,7 @@ class BypassCaptcha(Hook): RESPOND_URL = "http://bypasscaptcha.com/check_value.php" GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" + def setup(self): self.info = {} -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- 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 1c9c4e722..05cf29500 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -27,6 +27,7 @@ PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" class BypassCaptchaException(Exception): + def __init__(self, err): self.err = err -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- 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 05cf29500..5ac117818 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -125,11 +125,11 @@ class BypassCaptcha(Hook): def captchaCorrect(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: - self.respond(task.data["ticket"], True) + self.respond(task.data['ticket'], True) def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: - self.respond(task.data["ticket"], False) + self.respond(task.data['ticket'], False) def processCaptcha(self, task): c = task.captchaFile @@ -139,5 +139,5 @@ class BypassCaptcha(Hook): task.error = e.getCode() return - task.data["ticket"] = ticket + task.data['ticket'] = ticket task.setResult(result) -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'module/plugins/hooks/BypassCaptcha.py') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 5ac117818..d62de24a7 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -1,30 +1,12 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - -from thread import start_new_thread from pycurl import FORM_FILE, LOW_SPEED_TIME +from thread import start_new_thread -from module.network.RequestFactory import getURL, getRequest from module.network.HTTPRequest import BadHeader - +from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook -PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" - class BypassCaptchaException(Exception): @@ -43,8 +25,8 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" - __version__ = "0.04" __type__ = "hook" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force BC even if client is connected", False), @@ -54,6 +36,8 @@ class BypassCaptcha(Hook): __author_name__ = ("RaNaN", "Godofdream", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "soilfcition@gmail.com", "zoidberg@mujmail.cz") + PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" + SUBMIT_URL = "http://bypasscaptcha.com/upload.php" RESPOND_URL = "http://bypasscaptcha.com/check_value.php" GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" @@ -76,7 +60,7 @@ class BypassCaptcha(Hook): try: response = req.load(self.SUBMIT_URL, - post={"vendor_key": PYLOAD_KEY, + post={"vendor_key": self.PYLOAD_KEY, "key": self.getConfig("passkey"), "gen_task_id": "1", "file": (FORM_FILE, captcha)}, -- cgit v1.2.3