summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-14 02:08:19 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-14 02:08:19 +0200
commit36e54a3ee89aafeffdc7eab789502decf11ca2ac (patch)
tree50379457400bb6f89eb75188aec4f22d3ebb7797 /module/plugins/internal
parentMerge pull request #1820 from Bambie42/stable (diff)
downloadpyload-36e54a3ee89aafeffdc7eab789502decf11ca2ac.tar.xz
Update main Captcha plugin
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/Captcha.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/module/plugins/internal/Captcha.py b/module/plugins/internal/Captcha.py
index 600fd1d34..b864fd2d8 100644
--- a/module/plugins/internal/Captcha.py
+++ b/module/plugins/internal/Captcha.py
@@ -12,7 +12,7 @@ from module.plugins.internal.Plugin import Plugin
class Captcha(Plugin):
__name__ = "Captcha"
__type__ = "captcha"
- __version__ = "0.42"
+ __version__ = "0.43"
__status__ = "testing"
__description__ = """Base anti-captcha plugin"""
@@ -50,18 +50,18 @@ class Captcha(Plugin):
pass
- def decrypt(self, url, get={}, post={}, ref=False, cookies=False, decode=False,
+ def decrypt(self, url, get={}, post={}, ref=False, cookies=True, decode=False,
input_type='jpg', output_type='textual', ocr=True, timeout=120):
img = self.load(url, get=get, post=post, ref=ref, cookies=cookies, decode=decode)
return self._decrypt(img, input_type, output_type, ocr, timeout)
#@TODO: Definitely choose a better name for this method!
- def _decrypt(self, raw, input_type='jpg', output_type='textual', ocr=False, timeout=120):
+ def _decrypt(self, data, input_type='jpg', output_type='textual', ocr=False, timeout=120):
"""
Loads a captcha and decrypts it with ocr, plugin, user input
- :param raw: image raw data
+ :param data: image raw data
:param get: get part for request
:param post: post part for request
:param cookies: True if cookies should be enabled
@@ -77,7 +77,7 @@ class Captcha(Plugin):
time_ref = ("%.2f" % time.time())[-6:].replace(".", "")
with open(os.path.join("tmp", "captcha_image_%s_%s.%s" % (self.plugin.__name__, time_ref, input_type)), "wb") as tmp_img:
- tmp_img.write(raw)
+ tmp_img.write(data)
if ocr:
if isinstance(ocr, basestring):
@@ -90,7 +90,7 @@ class Captcha(Plugin):
captchaManager = self.pyload.captchaManager
try:
- self.task = captchaManager.newTask(raw, input_type, tmp_img.name, output_type)
+ self.task = captchaManager.newTask(data, input_type, tmp_img.name, output_type)
captchaManager.handleCaptcha(self.task)