From 29f9dc8fb3396b03d732ebcbeb1cc8f00fe13897 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 25 Aug 2010 18:22:27 +0200 Subject: new dirs --- module/plugins/captcha/NetloadIn.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 module/plugins/captcha/NetloadIn.py (limited to 'module/plugins/captcha/NetloadIn.py') diff --git a/module/plugins/captcha/NetloadIn.py b/module/plugins/captcha/NetloadIn.py new file mode 100644 index 000000000..7f2e6a8d1 --- /dev/null +++ b/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') -- cgit v1.2.3