summaryrefslogtreecommitdiffstats
path: root/module/plugins/captcha/UlozTo.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2016-03-07 00:20:32 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2016-03-07 00:20:32 +0100
commite4fc68fee71f2bfee57932a04800406f44bdbf16 (patch)
treeda5e925ffa86b1a8cff22badcc28a4ab3064ec48 /module/plugins/captcha/UlozTo.py
parent[IRC] Update (diff)
parentAdded sound captcha options (diff)
downloadpyload-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.py26
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