From c5234a8b3d223f9860de161894ae8a4623e1ae05 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 17 Jun 2009 23:18:27 +0200 Subject: plugins can import captcha method, see #6 --- Plugins/Plugin.py | 8 +++++++- Plugins/YoutubeCom.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'Plugins') diff --git a/Plugins/Plugin.py b/Plugins/Plugin.py index a253ffb74..adcaa7678 100644 --- a/Plugins/Plugin.py +++ b/Plugins/Plugin.py @@ -26,6 +26,7 @@ class Plugin(): self.time_plus_wait = 0 #time() + wait in seconds self.want_reconnect = False self.multi_dl = True + self.ocr = None #captcha reader instance def set_parent_status(self): """ sets all available Statusinfos about a File in self.parent.status @@ -74,5 +75,10 @@ class Plugin(): self.config[option] = self.parser.get(self.props['name'], option, raw=True) self.config[option] = False if self.config[option].lower() == 'false' else self.config[option] + def init_ocr(self): + modul = __import__("captcha."+ self.props['name']) + captchaClass = getattr(modul, self.props['name']) + self.ocr = captchaClass() + def __call__(self): - return self.props['name'] \ No newline at end of file + return self.props['name'] diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py index 57025791c..c780345ee 100644 --- a/Plugins/YoutubeCom.py +++ b/Plugins/YoutubeCom.py @@ -57,4 +57,4 @@ class YoutubeCom(Plugin): if re.search(r"(.*eine fehlerhafte Video-ID\.)", self.html) != None: return False else: - return True \ No newline at end of file + return True -- cgit v1.2.3