summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-05-27 22:19:24 +0200
committerGravatar spoob <spoob@gmx.de> 2009-05-27 22:19:24 +0200
commit89e728b615355befb562c11c8076f661ee61f24f (patch)
tree52c11f16f2181f00ec8624f2ee092d63382ce06a
parentfixed log bug (diff)
downloadpyload-89e728b615355befb562c11c8076f661ee61f24f.tar.xz
created uniform plugin config, fixed some bugs
-rw-r--r--Core.py10
-rw-r--r--Plugins/Plugin.py16
-rw-r--r--Plugins/RSDF.py21
-rw-r--r--Plugins/RapidshareCom.py21
-rw-r--r--Plugins/UploadedTo.py21
-rw-r--r--Plugins/YoutubeCom.py21
-rw-r--r--module/thread_list.py4
7 files changed, 49 insertions, 65 deletions
diff --git a/Core.py b/Core.py
index 06d56403d..6b316abb5 100644
--- a/Core.py
+++ b/Core.py
@@ -77,12 +77,8 @@ class Core(object):
plugin_pattern = ""
plugin_file = basename(file_handler).replace('.py', '')
for line in open(file_handler, "r").readlines():
- try:
- plugin_pattern = re.search(r"self.plugin_pattern = r\"(.*)\"", line).group(1)
- break
- print line
- except:
- pass
+ if "plugin_config['pattern']" in line:
+ plugin_pattern = line.split("r\"")[1].split("\"")[0]
if plugin_pattern != "":
self.plugins_avaible[plugin_file] = plugin_pattern
self.logger.debug(plugin_file + " hinzugefuegt")
@@ -188,7 +184,7 @@ class Core(object):
for pyfile in self.thread_list.py_downloading:
if pyfile.status.type == 'downloading':
print pyfile.status.filename + ": speed is" ,int(pyfile.status.get_speed()) ,"kb/s"
- print pyfile.status.filename + ": arraives in" ,pyfile.status.get_ETA() ,"seconds"
+ print pyfile.status.filename + ": arraives in" ,int(pyfile.status.get_ETA()) ,"seconds"
elif pyfile.status.type == 'waiting':
print pyfile.status.filename + ": wait", int(pyfile.status.waituntil -time()) , "seconds"
diff --git a/Plugins/Plugin.py b/Plugins/Plugin.py
index f7ea99b7d..0eefd8d9b 100644
--- a/Plugins/Plugin.py
+++ b/Plugins/Plugin.py
@@ -11,14 +11,14 @@ class Plugin():
self.plugin_name = None
self.plugin_pattern = None
self.plugin_type = "hoster"
- pluginProp = {}
- pluginProp ['name'] = "Base Plugin"
- pluginProp ['version'] = "0.1"
- pluginProp ['format'] = "*.py"
- pluginProp ['description'] = """bla"""
- pluginProp ['author'] = "Spoob"
- pluginProp ['author_email'] = "nn@nn.de"
- self.pluginProp = pluginProp
+ plugin_config = {}
+ plugin_config['name'] = "Base Plugin"
+ plugin_config['version'] = "0.1"
+ plugin_config['format'] = "*.py"
+ plugin_config['description'] = """bla"""
+ plugin_config['author'] = "Spoob"
+ plugin_config['author_email'] = "nn@nn.de"
+ self.plugin_config = plugin_config
self.parent = parent
self.req = Request()
self.html = None
diff --git a/Plugins/RSDF.py b/Plugins/RSDF.py
index 65f01d41b..254f43f91 100644
--- a/Plugins/RSDF.py
+++ b/Plugins/RSDF.py
@@ -16,18 +16,15 @@ class RSDF(Plugin):
def __init__(self, parent):
Plugin.__init__(self, parent)
- self.plugin_name = "RSDF"
- self.plugin_pattern = r".*\.rsdf"
- self.plugin_type = "container"
- self.plugin_config = {}
- pluginProp = {}
- pluginProp ['name'] = "RSDF"
- pluginProp ['version'] = "0.1"
- pluginProp ['format'] = "*.py"
- pluginProp ['description'] = """RSDF Plugin"""
- pluginProp ['author'] = "RaNaN"
- pluginProp ['author_email'] = "RaNaN@pyload.org"
- self.pluginProp = pluginProp
+ plugin_config = {}
+ plugin_config['name'] = "RSDF"
+ plugin_config['type'] = "container"
+ plugin_config['pattern'] = r".*\.rsdf"
+ plugin_config['version'] = "0.2"
+ plugin_config['description'] = """RSDF Container Decode Plugin"""
+ plugin_config['author_name'] = ("RaNaN", "spoob")
+ plugin_config['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org")
+ self.plugin_config = plugin_config
self.parent = parent
self.multi_dl = True
self.links = []
diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py
index 0579ac8f8..68fcd7cf6 100644
--- a/Plugins/RapidshareCom.py
+++ b/Plugins/RapidshareCom.py
@@ -13,18 +13,15 @@ class RapidshareCom(Plugin):
def __init__(self, parent):
Plugin.__init__(self, parent)
- self.plugin_name = "Rapidshare.com"
- self.plugin_pattern = r"http://(?:www.)?rapidshare.com/files/"
- self.plugin_type = "hoster"
- self.plugin_config = {}
- pluginProp = {}
- pluginProp ['name'] = "RapidshareCom"
- pluginProp ['version'] = "0.1"
- pluginProp ['format'] = "*.py"
- pluginProp ['description'] = """Rapidshare Plugin"""
- pluginProp ['author'] = "spoob"
- pluginProp ['author_email'] = "nn@nn.de"
- self.pluginProp = pluginProp
+ plugin_config = {}
+ plugin_config['name'] = "RapidshareCom"
+ plugin_config['type'] = "hoster"
+ plugin_config['pattern'] = r"http://(?:www.)?rapidshare.com/files/"
+ plugin_config['version'] = "0.1"
+ plugin_config['description'] = """Rapidshare.com Download Plugin"""
+ plugin_config['author_name'] = ("spoob")
+ plugin_config['author_mail'] = ("spoob@pyload.org")
+ self.plugin_config = plugin_config
self.parent = parent
self.html = [None, None]
self.html_old = None #time() where loaded the HTML
diff --git a/Plugins/UploadedTo.py b/Plugins/UploadedTo.py
index d75a4eb95..17b6e5e7a 100644
--- a/Plugins/UploadedTo.py
+++ b/Plugins/UploadedTo.py
@@ -9,18 +9,15 @@ class UploadedTo(Plugin):
def __init__(self, parent):
Plugin.__init__(self, parent)
- self.plugin_name = "Uploaded.to"
- self.plugin_pattern = r"http://(www\.)?uploaded.to/"
- self.plugin_type = "hoster"
- self.plugin_config = {}
- pluginProp = {}
- pluginProp ['name'] = "UploadedTo"
- pluginProp ['version'] = "0.1"
- pluginProp ['format'] = "*.py"
- pluginProp ['description'] = """Uploaded Plugin"""
- pluginProp ['author'] = "spoob"
- pluginProp ['author_email'] = "spoob@gmx.de"
- self.pluginProp = pluginProp
+ plugin_config = {}
+ plugin_config['name'] = "UploadedTo"
+ plugin_config['type'] = "hoster"
+ plugin_config['pattern'] = r"http://(www\.)?uploaded.to/"
+ plugin_config['version'] = "0.1"
+ plugin_config['description'] = """Uploaded.to Download Plugin"""
+ plugin_config['author_name'] = ("spoob")
+ plugin_config['author_mail'] = ("spoob@pyload.org")
+ self.plugin_config = plugin_config
self.parent = parent
self.html = None
self.html_old = None #time() where loaded the HTML
diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py
index 0710711ea..31d2b60a4 100644
--- a/Plugins/YoutubeCom.py
+++ b/Plugins/YoutubeCom.py
@@ -9,18 +9,15 @@ class YoutubeCom(Plugin):
def __init__(self, parent):
Plugin.__init__(self, parent)
- self.plugin_name = "YoutubeCom"
- self.plugin_pattern = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
- self.plugin_type = "hoster"
- self.plugin_config = {}
- pluginProp = {}
- pluginProp ['name'] = "Youtube.com"
- pluginProp ['version'] = "0.1"
- pluginProp ['format'] = "*.py"
- pluginProp ['description'] = """Youtube Plugin"""
- pluginProp ['author'] = "spoob"
- pluginProp ['author_email'] = "spoob@pyload.org"
- self.pluginProp = pluginProp
+ plugin_config = {}
+ plugin_config['name'] = "YoutubeCom"
+ plugin_config['type'] = "hoster"
+ plugin_config['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
+ plugin_config['version'] = "0.1"
+ plugin_config['description'] = """Youtube.com Video Download Plugin"""
+ plugin_config['author_name'] = ("spoob")
+ plugin_config['author_mail'] = ("spoob@pyload.org")
+ self.plugin_config = plugin_config
self.parent = parent
self.html = None
self.html_old = None #time() where loaded the HTML
diff --git a/module/thread_list.py b/module/thread_list.py
index 7031b166e..4cd1f1978 100644
--- a/module/thread_list.py
+++ b/module/thread_list.py
@@ -88,11 +88,11 @@ class Thread_List(object):
if not pyfile.plugin.multi_dl:
self.occ_plugins.remove(pyfile.modul.__name__)
-
+
self.py_downloading.remove(pyfile)
self.parent.logger.info('finished downloading ' + pyfile.url + ' @'+str(pyfile.status.get_speed())+'kb/s')
- if pyfile.plugin.plugin_type == "container":
+ if pyfile.plugin.plugin_config['type'] == "container":
self.parent.extend_links(pyfile.plugin.links)
#remove from list, logging etc