diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2016-03-07 00:20:32 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2016-03-07 00:20:32 +0100 |
commit | e4fc68fee71f2bfee57932a04800406f44bdbf16 (patch) | |
tree | da5e925ffa86b1a8cff22badcc28a4ab3064ec48 /module/plugins/captcha/UlozTo.py | |
parent | [IRC] Update (diff) | |
parent | Added sound captcha options (diff) | |
download | pyload-e4fc68fee71f2bfee57932a04800406f44bdbf16.tar.xz |
Merge pull request #2375 from sodd/adecaptcha
[UlozTo] Added support for audio Captcha recognition
Diffstat (limited to 'module/plugins/captcha/UlozTo.py')
-rw-r--r-- | module/plugins/captcha/UlozTo.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/module/plugins/captcha/UlozTo.py b/module/plugins/captcha/UlozTo.py new file mode 100644 index 000000000..7e7297138 --- /dev/null +++ b/module/plugins/captcha/UlozTo.py @@ -0,0 +1,26 @@ +try: + import adecaptcha.clslib as clslib + adecaptcha_available = True +except ImportError: + adecaptcha_available = False + +import os.path + + + +class UlozTo(object): + __name__ = "UlozTo" + def __init__(self, plugin=None): + pass + self._plugin=plugin + + + def recognize(self, audio): + """ Audio decoding - more info could be found at https://launchpad.net/adecaptcha """ + #print "!!!CAPTCHA :", audio + if adecaptcha_available: + cfg_file=os.path.join(os.path.split(clslib.__file__)[0], 'ulozto.cfg') + text= clslib.classify_audio_file(audio, cfg_file) + return text + else: + pass |