diff options
Diffstat (limited to 'module/plugins/captcha')
-rw-r--r-- | module/plugins/captcha/GigasizeCom.py | 4 | ||||
-rw-r--r-- | module/plugins/captcha/LinksaveIn.py | 4 | ||||
-rw-r--r-- | module/plugins/captcha/NetloadIn.py | 4 | ||||
-rw-r--r-- | module/plugins/captcha/ShareonlineBiz.py | 4 | ||||
-rw-r--r-- | module/plugins/captcha/captcha.py | 46 |
5 files changed, 17 insertions, 45 deletions
diff --git a/module/plugins/captcha/GigasizeCom.py b/module/plugins/captcha/GigasizeCom.py index 1f77e420d..add3ffc57 100644 --- a/module/plugins/captcha/GigasizeCom.py +++ b/module/plugins/captcha/GigasizeCom.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from captcha import OCR +from module.plugins.captcha import OCR class GigasizeCom(OCR): __name__ = "GigasizeCom" - __version__ = "0.1" __type__ = "ocr" + __version__ = "0.1" __description__ = """Gigasize.com ocr plugin""" __author_name__ = "pyLoad Team" diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index da36cf552..dd5ac7b98 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -5,13 +5,13 @@ from glob import glob from os import sep from os.path import abspath, dirname -from captcha import OCR +from module.plugins.captcha import OCR class LinksaveIn(OCR): __name__ = "LinksaveIn" - __version__ = "0.1" __type__ = "ocr" + __version__ = "0.1" __description__ = """Linksave.in ocr plugin""" __author_name__ = "pyLoad Team" diff --git a/module/plugins/captcha/NetloadIn.py b/module/plugins/captcha/NetloadIn.py index 4585b51df..cb6cb9264 100644 --- a/module/plugins/captcha/NetloadIn.py +++ b/module/plugins/captcha/NetloadIn.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from captcha import OCR +from module.plugins.captcha import OCR class NetloadIn(OCR): __name__ = "NetloadIn" - __version__ = "0.1" __type__ = "ocr" + __version__ = "0.1" __description__ = """Netload.in ocr plugin""" __author_name__ = "pyLoad Team" diff --git a/module/plugins/captcha/ShareonlineBiz.py b/module/plugins/captcha/ShareonlineBiz.py index 44ea6a187..aab4e9da0 100644 --- a/module/plugins/captcha/ShareonlineBiz.py +++ b/module/plugins/captcha/ShareonlineBiz.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from captcha import OCR +from module.plugins.captcha import OCR class ShareonlineBiz(OCR): __name__ = "ShareonlineBiz" - __version__ = "0.1" __type__ = "ocr" + __version__ = "0.1" __description__ = """Shareonline.biz ocr plugin""" __author_name__ = "RaNaN" diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index 061228c99..cc07f50cf 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -1,35 +1,18 @@ # -*- coding: utf-8 -*- -# -#Copyright (C) 2009 kingzero, RaNaN -# -#This program is free software; you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 3 of the License, -#or (at your option) any later version. -# -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#See the GNU General Public License for more details. -# -#You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -### from __future__ import with_statement -import os -from os.path import join -from os.path import abspath + +import GifImagePlugin +import Image +import JpegImagePlugin +import PngImagePlugin +import TiffImagePlugin import logging +import os import subprocess #import tempfile -import Image -import TiffImagePlugin -import PngImagePlugin -import GifImagePlugin -import JpegImagePlugin +from os.path import abspath, join class OCR(object): @@ -82,7 +65,7 @@ class OCR(object): self.image.save(tmp.name, 'TIFF') if os.name == "nt": - tessparams = [join(pypath,"tesseract","tesseract.exe")] + tessparams = [join(pypath, "tesseract", "tesseract.exe")] else: tessparams = ["tesseract"] @@ -318,14 +301,3 @@ class OCR(object): return result else: self.result_captcha = result - - -if __name__ == '__main__': - ocr = OCR() - ocr.load_image("B.jpg") - ocr.to_greyscale() - ocr.eval_black_white(140) - ocr.derotate_by_average() - ocr.run_tesser() - print "Tesseract", ocr.result_captcha - ocr.image.save("derotated.jpg") |