summaryrefslogtreecommitdiffstats
path: root/Plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-06-17 23:18:27 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-06-17 23:18:27 +0200
commitc5234a8b3d223f9860de161894ae8a4623e1ae05 (patch)
treed98aa17e3c0e738940e8957b390cd32e4b0955ee /Plugins
parentadded a error message if gui cant connect to server (diff)
downloadpyload-c5234a8b3d223f9860de161894ae8a4623e1ae05.tar.xz
plugins can import captcha method, see #6
Diffstat (limited to 'Plugins')
-rw-r--r--Plugins/Plugin.py8
-rw-r--r--Plugins/YoutubeCom.py2
2 files changed, 8 insertions, 2 deletions
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