summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar sodd <sodd@users.noreply.github.com> 2016-02-27 20:30:30 +0100
committerGravatar sodd <sodd@users.noreply.github.com> 2016-02-27 20:30:30 +0100
commite841418695220beecce48623dc060ea10a0896b3 (patch)
tree76dff5c0d9219d803ee585a1af988a17008a5dd4
parent[ReCaptcha] fix #2364 (diff)
downloadpyload-e841418695220beecce48623dc060ea10a0896b3.tar.xz
[Captcha - UlozTo] init
-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