diff options
author | mkaay <mkaay@mkaay.de> | 2010-08-25 16:48:55 +0200 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-08-25 16:48:55 +0200 |
commit | 3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea (patch) | |
tree | c5b2b1bfeb7eb8df2b97be118f6cbcec4e29cb3b /core/module/plugins/captcha/NetloadIn.py | |
parent | ul.to fetching, so.biz expire (diff) | |
download | pyload-3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea.tar.xz |
merged gui
Diffstat (limited to 'core/module/plugins/captcha/NetloadIn.py')
-rw-r--r-- | core/module/plugins/captcha/NetloadIn.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/module/plugins/captcha/NetloadIn.py b/core/module/plugins/captcha/NetloadIn.py new file mode 100644 index 000000000..7f2e6a8d1 --- /dev/null +++ b/core/module/plugins/captcha/NetloadIn.py @@ -0,0 +1,24 @@ +from captcha import OCR + +class NetloadIn(OCR): + __name__ = "NetloadIn" + def __init__(self): + OCR.__init__(self) + + def get_captcha(self, image): + self.load_image(image) + self.to_greyscale() + self.clean(3) + self.clean(3) + self.run_tesser(True, True, False, False) + + 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') |