diff options
author | Sleeper <devnull@localhost> | 2010-04-12 21:51:44 +0200 |
---|---|---|
committer | Sleeper <devnull@localhost> | 2010-04-12 21:51:44 +0200 |
commit | b849139d38d9cebd367879d9a3323dfde733e866 (patch) | |
tree | 5c3e609bb343e92a421cfc5725ca1df0f55401b3 /module/plugins/captcha/LinksaveIn.py | |
parent | set_conf fix (diff) | |
download | pyload-b849139d38d9cebd367879d9a3323dfde733e866.tar.xz |
fix netload and shareonline, captcha subsets for better recognition
Diffstat (limited to 'module/plugins/captcha/LinksaveIn.py')
-rw-r--r-- | module/plugins/captcha/LinksaveIn.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index d6f61e362..22b801273 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -118,20 +118,6 @@ class LinksaveIn(OCR): self.image = new self.pixels = self.image.load() - 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", ""), "nobatch", self.data_dir+"tesser_conf"]) - self.logger.debug("read txt") - - with open(tmpTxt.name, 'r') as f: - self.result_captcha = f.read().replace("\n", "") - def get_captcha(self, image): self.load_image(image) bg = self.get_bg() @@ -147,7 +133,7 @@ class LinksaveIn(OCR): for n, letter in enumerate(letters): self.image = letter self.image.save(ocr.data_dir+"letter%d.png" % n) - self.run_tesser() + self.run_tesser(True, True, False, False) final += self.result_captcha return final |