summaryrefslogtreecommitdiffstats
path: root/module/plugins/ocr
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/ocr')
-rw-r--r--module/plugins/ocr/GigasizeCom.py17
-rw-r--r--module/plugins/ocr/LinksaveIn.py19
-rw-r--r--module/plugins/ocr/NetloadIn.py15
-rw-r--r--module/plugins/ocr/ShareonlineBiz.py33
4 files changed, 36 insertions, 48 deletions
diff --git a/module/plugins/ocr/GigasizeCom.py b/module/plugins/ocr/GigasizeCom.py
index 8f9d78710..ba0b805e6 100644
--- a/module/plugins/ocr/GigasizeCom.py
+++ b/module/plugins/ocr/GigasizeCom.py
@@ -2,7 +2,17 @@
from module.plugins.OCR import OCR
+
class GigasizeCom(OCR):
+ __name__ = "GigasizeCom"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """Gigasize.com ocr plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
+
+
def __init__(self):
OCR.__init__(self)
@@ -11,10 +21,3 @@ class GigasizeCom(OCR):
self.threshold(2.8)
self.run_tesser(True, False, False, True)
return self.result_captcha
-
-if __name__ == '__main__':
- ocr = GigasizeCom()
- import urllib
- urllib.urlretrieve('http://www.gigasize.com/randomImage.php', "gigasize_tmp.jpg")
-
- print ocr.get_captcha('gigasize_tmp.jpg')
diff --git a/module/plugins/ocr/LinksaveIn.py b/module/plugins/ocr/LinksaveIn.py
index 0ddd50a50..3ae139a4e 100644
--- a/module/plugins/ocr/LinksaveIn.py
+++ b/module/plugins/ocr/LinksaveIn.py
@@ -3,13 +3,20 @@
from module.plugins.OCR import OCR
from PIL import Image
from os import sep
-from os.path import dirname
-from os.path import abspath
+from os.path import abspath, dirname
from glob import glob
class LinksaveIn(OCR):
__name__ = "LinksaveIn"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """Linksave.in ocr plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
+
+
def __init__(self):
OCR.__init__(self)
self.data_dir = dirname(abspath(__file__)) + sep + "LinksaveIn" + sep
@@ -139,11 +146,3 @@ class LinksaveIn(OCR):
final += self.result_captcha
return final
-
-if __name__ == '__main__':
- import urllib
- ocr = LinksaveIn()
- testurl = "http://linksave.in/captcha/cap.php?hsh=2229185&code=ZzHdhl3UffV3lXTH5U4b7nShXj%2Bwma1vyoNBcbc6lcc%3D"
- urllib.urlretrieve(testurl, ocr.data_dir+"captcha.gif")
-
- print ocr.get_captcha(ocr.data_dir+'captcha.gif')
diff --git a/module/plugins/ocr/NetloadIn.py b/module/plugins/ocr/NetloadIn.py
index 9fc2f0725..0de88302e 100644
--- a/module/plugins/ocr/NetloadIn.py
+++ b/module/plugins/ocr/NetloadIn.py
@@ -4,6 +4,14 @@ from module.plugins.OCR import OCR
class NetloadIn(OCR):
__name__ = "NetloadIn"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """Netload.in ocr plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
+
+
def __init__(self):
OCR.__init__(self)
@@ -17,10 +25,3 @@ class NetloadIn(OCR):
self.result_captcha = self.result_captcha.replace(" ", "")[:4] # cut to 4 numbers
return self.result_captcha
-
-if __name__ == '__main__':
- import urllib
- ocr = NetloadIn()
- urllib.urlretrieve("http://netload.in/share/includes/captcha.php", "captcha.png")
-
- print ocr.get_captcha('captcha.png')
diff --git a/module/plugins/ocr/ShareonlineBiz.py b/module/plugins/ocr/ShareonlineBiz.py
index db72449d1..0ad018bf9 100644
--- a/module/plugins/ocr/ShareonlineBiz.py
+++ b/module/plugins/ocr/ShareonlineBiz.py
@@ -1,31 +1,22 @@
# -*- 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 module.plugins.OCR import OCR
+
class ShareonlineBiz(OCR):
__name__ = "ShareonlineBiz"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """Shareonline.biz ocr plugin"""
+ __author_name__ = "RaNaN"
+ __author_mail__ = "RaNaN@pyload.org"
+
def __init__(self):
OCR.__init__(self)
- def get_captcha(self, image):
+ def get_captcha(self, image):
self.load_image(image)
self.to_greyscale()
self.image = self.image.resize((160, 50))
@@ -45,9 +36,3 @@ class ShareonlineBiz(OCR):
return final
#tesseract at 60%
-
-if __name__ == '__main__':
- import urllib
- ocr = ShareonlineBiz()
- urllib.urlretrieve("http://www.share-online.biz/captcha.php", "captcha.jpeg")
- print ocr.get_captcha('captcha.jpeg')