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.py41
1 files changed, 14 insertions, 27 deletions
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
index 70e60f56c..d62de24a7 100644
--- a/module/plugins/hooks/BypassCaptcha.py
+++ b/module/plugins/hooks/BypassCaptcha.py
@@ -1,34 +1,15 @@
# -*- 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 <http://www.gnu.org/licenses/>.
-
- @author: RaNaN, Godofdream, zoidberg
-"""
-
-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):
+
def __init__(self, err):
self.err = err
@@ -44,18 +25,24 @@ class BypassCaptchaException(Exception):
class BypassCaptcha(Hook):
__name__ = "BypassCaptcha"
+ __type__ = "hook"
__version__ = "0.04"
- __description__ = """Send captchas to BypassCaptcha.com"""
+
__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")
+ 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"
+
def setup(self):
self.info = {}
@@ -73,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)},
@@ -122,11 +109,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
@@ -136,5 +123,5 @@ class BypassCaptcha(Hook):
task.error = e.getCode()
return
- task.data["ticket"] = ticket
+ task.data['ticket'] = ticket
task.setResult(result)