summaryrefslogtreecommitdiffstats
path: root/captcha/captcha.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-12 17:26:38 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-12 17:26:38 +0200
commitf5c3720a5cdfc93734733b4ac8aba79289197f8f (patch)
treefb39d1bdfec4999da9bc0b46dc731328d6fc54e8 /captcha/captcha.py
parentpycurl interface, need some testing (diff)
downloadpyload-f5c3720a5cdfc93734733b4ac8aba79289197f8f.tar.xz
time-, plugin fix, debug output
Diffstat (limited to 'captcha/captcha.py')
-rw-r--r--captcha/captcha.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/captcha/captcha.py b/captcha/captcha.py
index a21963c6b..ffb165dbf 100644
--- a/captcha/captcha.py
+++ b/captcha/captcha.py
@@ -82,12 +82,15 @@ class OCR(object):
self.result_captcha = self.run(['gocr', tmp.name]).replace("\n", "")
def run_tesser(self):
+ self.logger.debug("create tmp tif")
tmp = tempfile.NamedTemporaryFile(suffix=".tif")
+ self.logger.debug("create tmp txt")
tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt")
-
+ self.logger.debug("save tiff")
self.image.save(tmp.name, 'TIFF')
+ self.logger.debug("run tesseract")
self.run(['tesseract', tmp.name, tmpTxt.name.replace(".txt", "")])
-
+ self.logger.debug("run cat")
self.result_captcha = self.run(['cat', tmpTxt.name]).replace("\n", "")
def get_captcha(self):