summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar sodd <sodd@users.noreply.github.com> 2016-02-27 20:36:19 +0100
committerGravatar sodd <sodd@users.noreply.github.com> 2016-02-27 20:36:19 +0100
commit5de006af2e91e8e627d6e4f6223a130e0a72cdf0 (patch)
tree06b78d9b85e35e8c1a2a8ee63688231d270cf2d3
parent[Captcha - UlozTo] init (diff)
downloadpyload-5de006af2e91e8e627d6e4f6223a130e0a72cdf0.tar.xz
Added sound captcha options
-rw-r--r--module/plugins/hoster/UlozTo.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py
index 1e9c2813d..12fe83c47 100644
--- a/module/plugins/hoster/UlozTo.py
+++ b/module/plugins/hoster/UlozTo.py
@@ -15,7 +15,7 @@ def convert_decimal_prefix(m):
class UlozTo(SimpleHoster):
__name__ = "UlozTo"
__type__ = "hoster"
- __version__ = "1.19"
+ __version__ = "1.20"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P<ID>\w+/[^/?]*)'
@@ -23,6 +23,7 @@ class UlozTo(SimpleHoster):
("use_premium" , "bool", "Use premium account if available" , True),
("fallback" , "bool", "Fallback to free download if premium fails" , True),
("chk_filesize", "bool", "Check file size" , True),
+ ("captcha" , "Image;Sound", "Captcha recognition" , "Image"),
("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )]
__description__ = """Uloz.to hoster plugin"""
@@ -78,6 +79,10 @@ class UlozTo(SimpleHoster):
self.log_debug("xapca: %s" % xapca)
data = json.loads(xapca)
+ if self.config.get("captcha") == "Image":
+ captcha_value = self.captcha.decrypt(data['image'])
+ else:
+ captcha_value = self.captcha.decrypt(str(data['sound']), input_type='wav', ocr="UlozTo")
captcha_value = self.captcha.decrypt(data['image'])
self.log_debug("CAPTCHA HASH: " + data['hash'], "CAPTCHA SALT: %s" % data['salt'], "CAPTCHA VALUE: " + captcha_value)
@@ -135,7 +140,8 @@ class UlozTo(SimpleHoster):
})
if check == "wrong_captcha":
- self.retry_captcha()
+ self.captcha.invalid()
+ self.retry(msg=_("Wrong captcha code"))
elif check == "offline":
self.offline()