diff options
author | Sleeper <devnull@localhost> | 2010-04-12 22:25:31 +0200 |
---|---|---|
committer | Sleeper <devnull@localhost> | 2010-04-12 22:25:31 +0200 |
commit | 497821fb18a93cdb356d5d1e6d3ae215b5cc1915 (patch) | |
tree | ad3047947f8de323cb6e470924b3d34bcb456f5e /module/plugins/captcha/captcha.py | |
parent | fix netload and shareonline, captcha subsets for better recognition (diff) | |
download | pyload-497821fb18a93cdb356d5d1e6d3ae215b5cc1915.tar.xz |
captcha fix
Diffstat (limited to 'module/plugins/captcha/captcha.py')
-rw-r--r-- | module/plugins/captcha/captcha.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index 452952533..eec63b54f 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -82,7 +82,7 @@ class OCR(object): self.image.save(tmp) self.result_captcha = self.run(['gocr', tmp.name]).replace("\n", "") - def run_tesser(self, subset=False, digits=True, lowercase=True, uppercase=True ): + def run_tesser(self, subset=False, digits=True, lowercase=True, uppercase=True): self.logger.debug("create tmp tif") tmp = tempfile.NamedTemporaryFile(suffix=".tif") self.logger.debug("create tmp txt") @@ -90,7 +90,7 @@ class OCR(object): self.logger.debug("save tiff") self.image.save(tmp.name, 'TIFF') - tessparams = ['tesseract', tmp.name, tmpTxt.name.replace(".txt", "") + tessparams = ['tesseract', tmp.name, tmpTxt.name.replace(".txt", "")] if subset and (digits or lowercase or uppercase): self.logger.debug("create temp subset config") @@ -102,6 +102,7 @@ class OCR(object): tmpSub.write("abcdefghijklmnopqrstuvwxyz") if uppercase: tmpSub.write("ABCDEFGHIJKLMNOPQRSTUVWXYZ") + tmpSub.write("\n") tessparams.append("nobatch") tessparams.append(tmpSub.name) |