summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/DownloadThread.py4
-rw-r--r--module/FileList.py23
-rw-r--r--module/HookManager.py19
-rw-r--r--module/PluginManager.py99
-rw-r--r--module/ThreadManager.py4
-rw-r--r--module/XMLConfigParser.py18
-rw-r--r--module/config/core_default.xml57
-rw-r--r--module/network/MultipartPostHandler.py139
-rw-r--r--module/plugins/Container.py29
-rw-r--r--module/plugins/Crypter.py28
-rw-r--r--module/plugins/Hook.py16
-rw-r--r--module/plugins/Hoster.py29
-rw-r--r--module/plugins/Plugin.py29
-rw-r--r--module/plugins/container/CCF.py21
-rw-r--r--module/plugins/container/LinkList.py21
-rw-r--r--module/plugins/container/RSDF.py21
-rw-r--r--module/plugins/crypter/DDLMusicOrg.py (renamed from module/plugins/decrypter/DDLMusicOrg.py)22
-rw-r--r--module/plugins/crypter/FourChanOrg.py (renamed from module/plugins/decrypter/FourChanOrg.py)22
-rw-r--r--module/plugins/crypter/HoerbuchIn.py (renamed from module/plugins/decrypter/HoerbuchIn.py)22
-rw-r--r--module/plugins/crypter/LixIn.py (renamed from module/plugins/decrypter/LixIn.py)22
-rw-r--r--module/plugins/crypter/OneKhDe.py (renamed from module/plugins/decrypter/OneKhDe.py)22
-rw-r--r--module/plugins/crypter/RSLayerCom.py (renamed from module/plugins/decrypter/RSLayerCom.py)22
-rw-r--r--module/plugins/crypter/RelinkUs.py (renamed from module/plugins/decrypter/RelinkUs.py)22
-rw-r--r--module/plugins/crypter/SecuredIn.py (renamed from module/plugins/decrypter/SecuredIn.py)23
-rw-r--r--module/plugins/crypter/SerienjunkiesOrg.py (renamed from module/plugins/decrypter/SerienjunkiesOrg.py)0
-rw-r--r--module/plugins/crypter/StealthTo.py (renamed from module/plugins/decrypter/StealthTo.py)22
-rw-r--r--module/plugins/crypter/YoutubeChannel.py (renamed from module/plugins/decrypter/YoutubeChannel.py)22
-rw-r--r--module/plugins/crypter/__init__.py (renamed from module/plugins/decrypter/__init__.py)0
-rw-r--r--module/plugins/hooks/ClickAndLoad.py14
-rw-r--r--module/plugins/hooks/ContainerDownload.py14
-rw-r--r--module/plugins/hooks/ExternalScripts.py14
-rw-r--r--module/plugins/hooks/LinuxFileEvents.py11
-rw-r--r--module/plugins/hoster/DepositfilesCom.py22
-rw-r--r--module/plugins/hoster/DuckloadCom.py22
-rw-r--r--module/plugins/hoster/FilefactoryCom.py22
-rw-r--r--module/plugins/hoster/FilesmonsterCom.py24
-rw-r--r--module/plugins/hoster/FreakshareNet.py22
-rw-r--r--module/plugins/hoster/GigasizeCom.py22
-rw-r--r--module/plugins/hoster/HotfileCom.py22
-rw-r--r--module/plugins/hoster/MegauploadCom.py22
-rw-r--r--module/plugins/hoster/MegavideoCom.py23
-rw-r--r--module/plugins/hoster/MyvideoDe.py23
-rw-r--r--module/plugins/hoster/NetloadIn.py22
-rw-r--r--module/plugins/hoster/RapidshareCom.py22
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py22
-rw-r--r--module/plugins/hoster/ShragleCom.py22
-rw-r--r--module/plugins/hoster/StorageTo.py21
-rw-r--r--module/plugins/hoster/UploadedTo.py22
-rw-r--r--module/plugins/hoster/XupIn.py22
-rw-r--r--module/plugins/hoster/YoupornCom.py22
-rw-r--r--module/plugins/hoster/YoutubeCom.py22
-rw-r--r--module/plugins/hoster/ZippyshareCom.py22
-rw-r--r--module/plugins/hoster/ZshareNet.py22
-rwxr-xr-xpyLoadCore.py24
54 files changed, 795 insertions, 525 deletions
diff --git a/module/DownloadThread.py b/module/DownloadThread.py
index 3cfaed780..fe371ceba 100644
--- a/module/DownloadThread.py
+++ b/module/DownloadThread.py
@@ -39,7 +39,7 @@ class Status(object):
self.url = None
self.exists = False
self.waituntil = 0
- self.plugin = pyfile.modul.__name__
+ self.plugin = pyfile.plugin.__name__
self.want_reconnect = False
self.error = ""
@@ -130,7 +130,7 @@ class DownloadThread(Thread):
pyfile.plugin.req.set_timeout(self.parent.parent.config['general']['max_download_time'])
- if pyfile.plugin.props["type"] == "container":
+ if pyfile.plugin.__type__ == "container":
status.type = "decrypting"
else:
status.type = "downloading"
diff --git a/module/FileList.py b/module/FileList.py
index 665e4bec5..b785af6de 100644
--- a/module/FileList.py
+++ b/module/FileList.py
@@ -119,8 +119,8 @@ class FileList(object):
for thread_list only, returns all elements that are suitable for downloadthread
"""
files = []
- files += [[x for x in p.files if x.status.type == None and x.plugin.props['type'] == "container" and not x.active] for p in self.data["queue"] + self.data["packages"]]
- files += [[x for x in p.files if (x.status.type == None or x.status.type == "reconnected") and not x.active and not x.modul.__name__ in occ] for p in self.data["queue"]]
+ files += [[x for x in p.files if x.status.type == None and x.plugin.__type__ == "container" and not x.active] for p in self.data["queue"] + self.data["packages"]]
+ files += [[x for x in p.files if (x.status.type == None or x.status.type == "reconnected") and not x.active and not x.plugin.__name__ in occ] for p in self.data["queue"]]
return reduce(concat, files, [])
@@ -148,7 +148,7 @@ class FileList(object):
info["status_error"] = pyfile.status.error
info["size"] = pyfile.status.size()
info["active"] = pyfile.active
- info["plugin"] = pyfile.plugin.props['name']
+ info["plugin"] = pyfile.plugin.__name__
try:
info["package"] = pypack.data["id"]
except:
@@ -422,25 +422,10 @@ class PyLoadFile():
def init(self):
self.active = False
- pluginName = self._get_my_plugin()
- if pluginName:
- for dir in ["hoster", "decrypter", "container"]:
- try:
- self.modul = __import__("%s.%s" % (dir, pluginName), globals(), locals(), [pluginName], -1)
- except ImportError:
- pass
- pluginClass = getattr(self.modul, pluginName)
- else:
- self.modul = module.plugins.Plugin
- pluginClass = module.plugins.Plugin.Plugin
+ pluginClass = self.core.pluginManager.getPluginFromPattern(self.url)
self.plugin = pluginClass(self)
self.status = Status(self)
self.status.filename = self.url
-
- def _get_my_plugin(self):
- for plugin, plugin_pattern in self.core.plugins_avaible.items():
- if re.match(plugin_pattern, self.url) != None:
- return plugin
def init_download(self):
if self.core.config['proxy']['activated']:
diff --git a/module/HookManager.py b/module/HookManager.py
index fa6df3323..d37c904a9 100644
--- a/module/HookManager.py
+++ b/module/HookManager.py
@@ -17,10 +17,8 @@
@author: mkaay
@interface-version: 0.1
"""
-from glob import glob
+
import logging
-from os.path import basename
-from os.path import join
from threading import Lock
from module.XMLConfigParser import XMLConfigParser
@@ -28,9 +26,9 @@ from module.XMLConfigParser import XMLConfigParser
class HookManager():
def __init__(self, core):
self.core = core
- self.configParser = XMLConfigParser(join(core.path, "module", "config", "plugin.xml"))
+ self.configParser = self.core.parser_plugins
self.configParser.loadData()
- self.config = self.configParser.getConfig()
+ self.config = self.configParser.getConfig()
self.logger = logging.getLogger("log")
self.plugins = []
self.lock = Lock()
@@ -39,19 +37,20 @@ class HookManager():
def createIndex(self):
self.lock.acquire()
- pluginFiles = glob(join(self.core.plugin_folder, "hooks", "*.py"))
plugins = []
- for pluginFile in pluginFiles:
- pluginName = basename(pluginFile).replace(".py", "")
- if pluginName == "__init__":
+ pluginStr = self.core.config["plugins"]["load_hook_plugins"]
+ for pluginModule in pluginStr.split(","):
+ pluginModule = pluginModule.strip()
+ if not pluginModule:
continue
+ pluginName = pluginModule.split(".")[-1]
if pluginName in self.config.keys():
if not self.config[pluginName]["activated"]:
self.logger.info("Deactivated %s" % pluginName)
continue
else:
self.configParser.set(pluginName, {"option": "activated", "type": "bool", "name": "Activated"}, True)
- module = __import__("module.plugins.hooks." + pluginName, globals(), locals(), [pluginName], -1)
+ module = __import__(pluginModule, globals(), locals(), [pluginName], -1)
pluginClass = getattr(module, pluginName)
try:
plugin = pluginClass(self.core)
diff --git a/module/PluginManager.py b/module/PluginManager.py
new file mode 100644
index 000000000..f4a3ee8ee
--- /dev/null
+++ b/module/PluginManager.py
@@ -0,0 +1,99 @@
+# -*- coding: utf-8 -*-
+
+"""
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+ @author: mkaay
+ @interface-version: 0.1
+"""
+
+import logging
+import re
+from threading import Lock
+
+from module.XMLConfigParser import XMLConfigParser
+from module.plugins.Hoster import Hoster
+
+from sys import version_info
+
+class PluginManager():
+ def __init__(self, core):
+ self.core = core
+ self.configParser = self.core.xmlconfig
+ self.configParser.loadData()
+ self.config = self.configParser.getConfig()
+ self.logger = logging.getLogger("log")
+ self.crypterPlugins = []
+ self.containerPlugins = []
+ self.hosterPlugins = []
+ self.captchaPlugins = []
+ self.accountPlugins = []
+ self.lock = Lock()
+ self.createIndex()
+
+ def createIndex(self):
+ self.lock.acquire()
+
+ self.crypterPlugins = self.parse(self.core.config["plugins"]["load_crypter_plugins"], _("Crypter"))
+ self.containerPlugins = self.parse(self.core.config["plugins"]["load_container_plugins"], _("Container"))
+ self.hosterPlugins = self.parse(self.core.config["plugins"]["load_hoster_plugins"], _("Hoster"))
+ self.captchaPlugins = self.parse(self.core.config["plugins"]["load_captcha_plugins"], _("Captcha"))
+ #self.accountPlugins = self.parse(self.core.config["plugins"]["load_account_plugins"], _("Account"))
+
+ self.lock.release()
+ self.logger.info(_("created index of plugins"))
+
+ def parse(self, pluginStr, ptype):
+ plugins = []
+ for pluginModule in pluginStr.split(","):
+ pluginModule = pluginModule.strip()
+ if not pluginModule:
+ continue
+ pluginName = pluginModule.split(".")[-1]
+ if pluginName.endswith("_25") and not version_info == (2, 5):
+ continue
+ elif pluginName.endswith("_26") and not version_info == (2, 6):
+ continue
+ module = __import__(pluginModule, globals(), locals(), [pluginName], -1)
+ pluginClass = getattr(module, pluginName)
+ try:
+ plugins.append(pluginClass)
+ self.logger.debug(_("%(type)s: %(name)s added") % {"name":pluginName, "type":ptype})
+ except:
+ pass
+ return plugins
+
+ def getPluginFromPattern(self, urlPattern):
+ plugins = []
+ plugins.extend(self.crypterPlugins)
+ plugins.extend(self.containerPlugins)
+ plugins.extend(self.hosterPlugins)
+ for plugin in plugins:
+ if not plugin.__pattern__:
+ continue
+ if re.match(plugin.__pattern__, urlPattern):
+ return plugin
+ return Hoster
+
+ def getCaptchaPlugin(self, name):
+ for plugin in self.captchaPlugins:
+ if plugin.__name__ == name:
+ return plugin
+ return None
+
+ def getAccountPlugin(self, name): # not implemeted yet!
+ for plugin in self.accountPlugins:
+ if plugin.__name__ == name:
+ return plugin
+ return None
diff --git a/module/ThreadManager.py b/module/ThreadManager.py
index be4fc46d2..bf632b180 100644
--- a/module/ThreadManager.py
+++ b/module/ThreadManager.py
@@ -89,7 +89,7 @@ class ThreadManager(Thread):
if not pyfile.plugin.multi_dl:
self.occ_plugins.append(pyfile.modul.__name__)
pyfile.active = True
- if pyfile.plugin.props['type'] == "container":
+ if pyfile.plugin.__type__ == "container":
self.parent.logger.info(_("Get links from: %s") % pyfile.url)
else:
self.parent.logger.info(_("Download starts: %s") % pyfile.url)
@@ -122,7 +122,7 @@ class ThreadManager(Thread):
self.py_downloading.remove(pyfile)
if pyfile.status.type == "finished":
- if pyfile.plugin.props['type'] == "container":
+ if pyfile.plugin.__type__ == "container":
newLinks = 0
if pyfile.plugin.links:
if isinstance(pyfile.plugin.links, dict):
diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py
index 575dbd219..b691ecb8e 100644
--- a/module/XMLConfigParser.py
+++ b/module/XMLConfigParser.py
@@ -21,7 +21,7 @@ from os.path import exists
from xml.dom.minidom import parse
import re
-from shutil import copy
+from shutil import copy, move
class XMLConfigParser():
def __init__(self, data, forceDefault=False, defaultFile=None):
@@ -54,8 +54,12 @@ class XMLConfigParser():
with open(file, 'r') as fh:
self.xml = parse(fh)
if not self.xml.documentElement.getAttribute("version") == self.version:
- print "Cant Update %s" % self.file
- exit() #ok?
+ print _("Cant Update %s, your config version is outdated") % self.file
+ i = raw_input(_("backup old file and copy new one? [%s]/%s") % (_("yes")[0], _("no")[0]))
+ if i == "" or i == _("yes")[0]:
+ move(self.file, self.file.replace(".xml", "_backup.xml"))
+ self.loadData(self)
+ return
self.root = self.xml.documentElement
self._read_config()
@@ -63,7 +67,7 @@ class XMLConfigParser():
try:
copy(self.file_default, self.file)
except:
- print "%s not found" % self.file_default
+ print _("%s not found") % self.file_default
exit() #ok?
def saveData(self):
@@ -215,7 +219,9 @@ class XMLConfigParser():
self.config[section]
return True
except:
- return False
+ if self.forceDefault:
+ return False
+ return self.defaultParser.isValidSection(section)
def checkInput(self, section, option, value):
oinput = self.getInputValues(section, option)
@@ -247,7 +253,7 @@ class Config(object):
def __getitem__(self, key):
if self.parser.isValidSection(key):
return Section(self.parser, key)
- raise Exception("invalid section")
+ raise Exception(_("invalid section"))
def keys(self):
return self.parser.config.keys()
diff --git a/module/config/core_default.xml b/module/config/core_default.xml
index e80892d46..4a0145bac 100644
--- a/module/config/core_default.xml
+++ b/module/config/core_default.xml
@@ -56,4 +56,61 @@
<adress type="str" name="Adress">http://localhost:8080</adress>
<protocol type="str" name="Protocol">http</protocol>
</proxy>
+ <plugins> <!-- python import style, separated with comma -->
+ <load_hook_plugins>
+ module.plugins.hooks.ClickAndLoad,
+ module.plugins.hooks.ContainerDownload,
+ module.plugins.hooks.ExternalScripts,
+ </load_hook_plugins>
+ <load_captcha_plugins>
+ module.plugins.captcha.GigasizeCom,
+ module.plugins.captcha.LinksaveIn,
+ module.plugins.captcha.MegauploadCom,
+ module.plugins.captcha.NetloadIn,
+ module.plugins.captcha.ShareonlineBiz,
+ </load_captcha_plugins>
+ <load_container_plugins>
+ module.plugins.container.CCF,
+ module.plugins.container.DLC_25,
+ module.plugins.container.DLC_26,
+ module.plugins.container.RSDF,
+ module.plugins.container.LinkList,
+ </load_container_plugins>
+ <load_crypter_plugins>
+ module.plugins.crypter.DDLMusicOrg,
+ module.plugins.crypter.FourChanOrg,
+ module.plugins.crypter.HoerbuchIn,
+ module.plugins.crypter.LixIn,
+ module.plugins.crypter.OneKhDe,
+ module.plugins.crypter.RelinkUs,
+ module.plugins.crypter.RSLayerCom,
+ module.plugins.crypter.SecuredIn,
+ module.plugins.crypter.SerienjunkiesOrg,
+ module.plugins.crypter.StealthTo,
+ module.plugins.crypter.YoutubeChannel,
+ </load_crypter_plugins>
+ <load_hoster_plugins>
+ module.plugins.hoster.DepositfilesCom,
+ module.plugins.hoster.DuckloadCom,
+ module.plugins.hoster.FilefactoryCom,
+ module.plugins.hoster.FilesmonsterCom,
+ module.plugins.hoster.FreakshareNet,
+ module.plugins.hoster.GigasizeCom,
+ module.plugins.hoster.HotfileCom,
+ module.plugins.hoster.MegauploadCom,
+ module.plugins.hoster.MegavideoCom,
+ module.plugins.hoster.MyvideoDe,
+ module.plugins.hoster.NetloadIn,
+ module.plugins.hoster.RapidshareCom,
+ module.plugins.hoster.ShareonlineBiz,
+ module.plugins.hoster.ShragleCom,
+ module.plugins.hoster.StorageTo,
+ module.plugins.hoster.UploadedTo,
+ module.plugins.hoster.XupIn,
+ module.plugins.hoster.YoupornCom,
+ module.plugins.hoster.YoutubeCom,
+ module.plugins.hoster.ZippyshareCom,
+ module.plugins.hoster.ZshareNet,
+ </load_hoster_plugins>
+ </plugins>
</config>
diff --git a/module/network/MultipartPostHandler.py b/module/network/MultipartPostHandler.py
new file mode 100644
index 000000000..6804bcc90
--- /dev/null
+++ b/module/network/MultipartPostHandler.py
@@ -0,0 +1,139 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+####
+# 02/2006 Will Holcomb <wholcomb@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# 7/26/07 Slightly modified by Brian Schneider
+# in order to support unicode files ( multipart_encode function )
+"""
+Usage:
+ Enables the use of multipart/form-data for posting forms
+
+Inspirations:
+ Upload files in python:
+ http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
+ urllib2_file:
+ Fabien Seisen: <fabien@seisen.org>
+
+Example:
+ import MultipartPostHandler, urllib2, cookielib
+
+ cookies = cookielib.CookieJar()
+ opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies),
+ MultipartPostHandler.MultipartPostHandler)
+ params = { "username" : "bob", "password" : "riviera",
+ "file" : open("filename", "rb") }
+ opener.open("http://wwww.bobsite.com/upload/", params)
+
+Further Example:
+ The main function of this file is a sample which downloads a page and
+ then uploads it to the W3C validator.
+"""
+
+import urllib
+import urllib2
+import mimetools, mimetypes
+import os, stat
+from cStringIO import StringIO
+
+class Callable:
+ def __init__(self, anycallable):
+ self.__call__ = anycallable
+
+# Controls how sequences are uncoded. If true, elements may be given multiple values by
+# assigning a sequence.
+doseq = 1
+
+class MultipartPostHandler(urllib2.BaseHandler):
+ handler_order = urllib2.HTTPHandler.handler_order - 10 # needs to run first
+
+ def http_request(self, request):
+ data = request.get_data()
+ if data is not None and type(data) != str:
+ v_files = []
+ v_vars = []
+ try:
+ for(key, value) in data.items():
+ if type(value) == file:
+ v_files.append((key, value))
+ else:
+ v_vars.append((key, value))
+ except TypeError:
+ systype, value, traceback = sys.exc_info()
+ raise TypeError, "not a valid non-string sequence or mapping object", traceback
+
+ if len(v_files) == 0:
+ data = urllib.urlencode(v_vars, doseq)
+ else:
+ boundary, data = self.multipart_encode(v_vars, v_files)
+
+ contenttype = 'multipart/form-data; boundary=%s' % boundary
+ if(request.has_header('Content-Type')
+ and request.get_header('Content-Type').find('multipart/form-data') != 0):
+ print "Replacing %s with %s" % (request.get_header('content-type'), 'multipart/form-data')
+ request.add_unredirected_header('Content-Type', contenttype)
+
+ request.add_data(data)
+
+ return request
+
+ def multipart_encode(vars, files, boundary = None, buf = None):
+ if boundary is None:
+ boundary = mimetools.choose_boundary()
+ if buf is None:
+ buf = StringIO()
+ for(key, value) in vars:
+ buf.write('--%s\r\n' % boundary)
+ buf.write('Content-Disposition: form-data; name="%s"' % key)
+ buf.write('\r\n\r\n' + value + '\r\n')
+ for(key, fd) in files:
+ file_size = os.fstat(fd.fileno())[stat.ST_SIZE]
+ filename = fd.name.split('/')[-1]
+ contenttype = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
+ buf.write('--%s\r\n' % boundary)
+ buf.write('Content-Disposition: form-data; name="%s"; filename="%s"\r\n' % (key, filename))
+ buf.write('Content-Type: %s\r\n' % contenttype)
+ # buffer += 'Content-Length: %s\r\n' % file_size
+ fd.seek(0)
+ buf.write('\r\n' + fd.read() + '\r\n')
+ buf.write('--' + boundary + '--\r\n\r\n')
+ buf = buf.getvalue()
+ return boundary, buf
+ multipart_encode = Callable(multipart_encode)
+
+ https_request = http_request
+
+def main():
+ import tempfile, sys
+
+ validatorURL = "http://validator.w3.org/check"
+ opener = urllib2.build_opener(MultipartPostHandler)
+
+ def validateFile(url):
+ temp = tempfile.mkstemp(suffix=".html")
+ os.write(temp[0], opener.open(url).read())
+ params = { "ss" : "0", # show source
+ "doctype" : "Inline",
+ "uploaded_file" : open(temp[1], "rb") }
+ print opener.open(validatorURL, params).read()
+ os.remove(temp[1])
+
+ if len(sys.argv[1:]) > 0:
+ for arg in sys.argv[1:]:
+ validateFile(arg)
+ else:
+ validateFile("http://www.google.com")
+
+if __name__=="__main__":
+ main() \ No newline at end of file
diff --git a/module/plugins/Container.py b/module/plugins/Container.py
new file mode 100644
index 000000000..2a7196f14
--- /dev/null
+++ b/module/plugins/Container.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+
+"""
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+ @author: mkaay
+"""
+
+from module.plugins.Plugin import Plugin
+
+class Container(Plugin):
+ __name__ = "Container"
+ __version__ = "0.1"
+ __pattern__ = None
+ __type__ = "container"
+ __description__ = """Base container plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
diff --git a/module/plugins/Crypter.py b/module/plugins/Crypter.py
new file mode 100644
index 000000000..31ea43262
--- /dev/null
+++ b/module/plugins/Crypter.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+"""
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+ @author: mkaay
+"""
+
+from module.plugins.Plugin import Plugin
+
+class Crypter(Plugin):
+ __version__ = "0.1"
+ __pattern__ = None
+ __type__ = "container"
+ __description__ = """Base crypter plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py
index 4a385c417..81188c147 100644
--- a/module/plugins/Hook.py
+++ b/module/plugins/Hook.py
@@ -22,22 +22,22 @@ import logging
class Hook():
+ __name__ = "Hook"
+ __version__ = "0.2"
+ __type__ = "hook"
+ __description__ = """interface for hook"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
def __init__(self, core):
self.logger = logging.getLogger("log")
self.configParser = core.parser_plugins
self.config = {}
- props = {}
- props['name'] = "Hook"
- props['version'] = "0.2"
- props['description'] = """interface for hook"""
- props['author_name'] = ("mkaay")
- props['author_mail'] = ("mkaay@mkaay.de")
- self.props = props
self.core = core
def readConfig(self):
self.configParser.loadData()
- section = self.props['name']
+ section = self.__name__
try:
self.config = self.configParser.getConfig()[section]
except:
diff --git a/module/plugins/Hoster.py b/module/plugins/Hoster.py
new file mode 100644
index 000000000..0ed528924
--- /dev/null
+++ b/module/plugins/Hoster.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+
+"""
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+ @author: mkaay
+"""
+
+from module.plugins.Plugin import Plugin
+
+class Hoster(Plugin):
+ __name__ = "Hoster"
+ __version__ = "0.1"
+ __pattern__ = None
+ __type__ = "hoster"
+ __description__ = """Base hoster plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index c4ac8ee12..107c4f0ca 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -32,19 +32,17 @@ from os import makedirs
from module.DownloadThread import CaptchaError
class Plugin():
-
+ __name__ = "Plugin"
+ __version__ = "0.4"
+ __pattern__ = None
+ __type__ = "hoster"
+ __description__ = """Base Plugin"""
+ __author_name__ = ("RaNaN", "spoob", "mkaay")
+ __author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org", "mkaay@mkaay.de")
+
def __init__(self, parent):
self.configparser = parent.core.parser_plugins
self.config = {}
- props = {}
- props['name'] = "BasePlugin"
- props['version'] = "0.3"
- props['pattern'] = None
- props['type'] = "hoster"
- props['description'] = """Base Plugin"""
- props['author_name'] = ("RaNaN", "spoob", "mkaay")
- props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org", "mkaay@mkaay.de")
- self.props = props
self.parent = parent
self.req = Request()
self.html = 0
@@ -115,20 +113,20 @@ class Plugin():
def set_config(self):
for k, v in self.config.items():
- self.configparser.set(self.props['name'], {"option": k}, v)
+ self.configparser.set(self.__name__, {"option": k}, v)
def remove_config(self, option):
- self.configparser.remove(self.props['name'], option)
+ self.configparser.remove(self.__name__, option)
def get_config(self, value, default=None):
self.configparser.loadData()
- return self.configparser.get(self.props['name'], value, default=default)
+ return self.configparser.get(self.__name__, value, default=default)
def read_config(self):
self.configparser.loadData()
try:
self.verify_config()
- self.config = self.configparser.getConfig()[self.props['name']]
+ self.config = self.configparser.getConfig()[self.__name__]
except:
pass
@@ -136,8 +134,7 @@ class Plugin():
pass
def init_ocr(self):
- modul = __import__("module.plugins.captcha." + self.props['name'], fromlist=['captcha'])
- captchaClass = getattr(modul, self.props['name'])
+ captchaClass = self.core.pluginManager.getCaptchaPlugin(self.__name__)
self.ocr = captchaClass()
def __call__(self):
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py
index 9d7116900..1e25ef623 100644
--- a/module/plugins/container/CCF.py
+++ b/module/plugins/container/CCF.py
@@ -5,22 +5,19 @@ import re
import tempfile
import urllib2
-from module.plugins.Plugin import Plugin
+from module.plugins.Container import Container
from module.network.MultipartPostHandler import MultipartPostHandler
-class CCF(Plugin):
+class CCF(Container):
+ __name__ = "CCF"
+ __version__ = "0.1"
+ __pattern__ = r"(?!http://).*\.ccf"
+ __description__ = """CCF Container Convert Plugin"""
+ __author_name__ = ("Willnix")
+ __author_mail__ = ("Willnix@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "CCF"
- props['type'] = "container"
- props['pattern'] = r"(?!http://).*\.ccf"
- props['version'] = "0.1"
- props['description'] = """CCF Container Convert Plugin"""
- props['author_name'] = ("Willnix")
- props['author_mail'] = ("Willnix@pyload.org")
- self.props = props
+ Container.__init__(self, parent)
self.parent = parent
self.multi_dl = True
self.links = []
diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py
index b45ab83d0..cadf491a9 100644
--- a/module/plugins/container/LinkList.py
+++ b/module/plugins/container/LinkList.py
@@ -2,21 +2,18 @@
# -*- coding: utf-8 -*-
-from module.plugins.Plugin import Plugin
+from module.plugins.Container import Container
-class LinkList(Plugin):
+class LinkList(Container):
+ __name__ = "LinkList"
+ __version__ = "0.1"
+ __pattern__ = r"(?!http://).*\.txt"
+ __description__ = """Read Link Lists in txt format"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "LinkList"
- props['type'] = "container"
- props['pattern'] = r"(?!http://).*\.txt"
- props['version'] = "0.1"
- props['description'] = """Read Link Lists in txt format"""
- props['author_name'] = ("Spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Container.__init__(self, parent)
self.parent = parent
self.html = None
self.read_config()
diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py
index 9604495fd..c906fe05a 100644
--- a/module/plugins/container/RSDF.py
+++ b/module/plugins/container/RSDF.py
@@ -4,21 +4,18 @@
import base64
import binascii
-from module.plugins.Plugin import Plugin
+from module.plugins.Container import Container
-class RSDF(Plugin):
+class RSDF(Container):
+ __name__ = "RSDF"
+ __version__ = "0.2"
+ __pattern__ = r"(?!http://).*\.rsdf"
+ __description__ = """RSDF Container Decode Plugin"""
+ __author_name__ = ("RaNaN", "spoob")
+ __author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "RSDF"
- props['type'] = "container"
- props['pattern'] = r"(?!http://).*\.rsdf"
- props['version'] = "0.2"
- props['description'] = """RSDF Container Decode Plugin"""
- props['author_name'] = ("RaNaN", "spoob")
- props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org")
- self.props = props
+ Container.__init__(self, parent)
self.parent = parent
self.multi_dl = True
self.links = []
diff --git a/module/plugins/decrypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py
index 63c684ff8..1c5632cda 100644
--- a/module/plugins/decrypter/DDLMusicOrg.py
+++ b/module/plugins/crypter/DDLMusicOrg.py
@@ -4,21 +4,19 @@
import re
from time import sleep
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class DDLMusicOrg(Plugin):
+class DDLMusicOrg(Crypter):
+ __name__ = "DDLMusicOrg"
+ __type__ = "container"
+ __pattern__ = r"http://[\w\.]*?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+"
+ __version__ = "0.1"
+ __description__ = """ddl-music.org Container Plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "DDLMusicOrg"
- props['type'] = "container"
- props['pattern'] = r"http://[\w\.]*?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+"
- props['version'] = "0.1"
- props['description'] = """ddl-music.org Container Plugin"""
- props['author_name'] = ("mkaay")
- props['author_mail'] = ("mkaay@mkaay.de")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
self.multi_dl = False
diff --git a/module/plugins/decrypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py
index 8960c74eb..cbcdd920c 100644
--- a/module/plugins/decrypter/FourChanOrg.py
+++ b/module/plugins/crypter/FourChanOrg.py
@@ -3,21 +3,19 @@
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class FourChanOrg(Plugin):
+class FourChanOrg(Crypter):
+ __name__ = "FourChanOrg"
+ __type__ = "container"
+ __pattern__ = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)"
+ __version__ = "0.1"
+ __description__ = """4chan.org Thread Download Plugin"""
+ __author_name__ = ("Spoob")
+ __author_mail__ = ("Spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "FourChanOrg"
- props['type'] = "container"
- props['pattern'] = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)"
- props['version'] = "0.1"
- props['description'] = """4chan.org Thread Download Plugin"""
- props['author_name'] = ("Spoob")
- props['author_mail'] = ("Spoob@pyload.org")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
diff --git a/module/plugins/decrypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py
index a318a00be..a40e5104b 100644
--- a/module/plugins/decrypter/HoerbuchIn.py
+++ b/module/plugins/crypter/HoerbuchIn.py
@@ -3,21 +3,19 @@
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class HoerbuchIn(Plugin):
+class HoerbuchIn(Crypter):
+ __name__ = "HoerbuchIn"
+ __type__ = "container"
+ __pattern__ = r"http://(www\.)?hoerbuch\.in/(blog\.php\?id=|download_(.*)\.html)"
+ __version__ = "0.4"
+ __description__ = """Hoerbuch.in Container Plugin"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "HoerbuchIn"
- props['type'] = "container"
- props['pattern'] = r"http://(www\.)?hoerbuch\.in/(blog\.php\?id=|download_(.*)\.html)"
- props['version'] = "0.4"
- props['description'] = """Hoerbuch.in Container Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
diff --git a/module/plugins/decrypter/LixIn.py b/module/plugins/crypter/LixIn.py
index c44f7e9da..168be2c27 100644
--- a/module/plugins/decrypter/LixIn.py
+++ b/module/plugins/crypter/LixIn.py
@@ -3,21 +3,19 @@
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class LixIn(Plugin):
+class LixIn(Crypter):
+ __name__ = "LixIn"
+ __type__ = "container"
+ __pattern__ = r"http://(www.)?lix.in/"
+ __version__ = "0.1"
+ __description__ = """Lix.in Container Plugin"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "LixIn"
- props['type'] = "container"
- props['pattern'] = r"http://(www.)?lix.in/"
- props['version'] = "0.1"
- props['description'] = """Lix.in Container Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
diff --git a/module/plugins/decrypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py
index 9db0a0147..c77203187 100644
--- a/module/plugins/decrypter/OneKhDe.py
+++ b/module/plugins/crypter/OneKhDe.py
@@ -4,21 +4,19 @@
import re
from module.unescape import unescape
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class OneKhDe(Plugin):
+class OneKhDe(Crypter):
+ __name__ = "OneKhDe"
+ __type__ = "container"
+ __pattern__ = r"http://(www\.)?1kh.de/f/"
+ __version__ = "0.1"
+ __description__ = """1kh.de Container Plugin"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "OneKhDe"
- props['type'] = "container"
- props['pattern'] = r"http://(www\.)?1kh.de/f/"
- props['version'] = "0.1"
- props['description'] = """1kh.de Container Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
diff --git a/module/plugins/decrypter/RSLayerCom.py b/module/plugins/crypter/RSLayerCom.py
index a939d9b1f..9ce211aa1 100644
--- a/module/plugins/decrypter/RSLayerCom.py
+++ b/module/plugins/crypter/RSLayerCom.py
@@ -4,21 +4,19 @@
import re
from module.unescape import unescape
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class RSLayerCom(Plugin):
+class RSLayerCom(Crypter):
+ __name__ = "RSLayerCom"
+ __type__ = "container"
+ __pattern__ = r"http://(www\.)?rs-layer.com/directory-"
+ __version__ = "0.1"
+ __description__ = """RS-Layer.com Container Plugin"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "RSLayerCom"
- props['type'] = "container"
- props['pattern'] = r"http://(www\.)?rs-layer.com/directory-"
- props['version'] = "0.1"
- props['description'] = """RS-Layer.com Container Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
diff --git a/module/plugins/decrypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index c8f8c4084..e043e65a9 100644
--- a/module/plugins/decrypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -4,21 +4,19 @@
import re
import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class RelinkUs(Plugin):
+class RelinkUs(Crypter):
+ __name__ = "RelinkUs"
+ __type__ = "container"
+ __pattern__ = r"http://(www\.)?relink.us/(f|((view|go).php))"
+ __version__ = "1.0"
+ __description__ = """Relink.us Container Plugin"""
+ __author_name__ = ("Sleeper-", "spoob")
+ __author_mail__ = ("@nonymous", "spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "RelinkUs"
- props['type'] = "container"
- props['pattern'] = r"http://(www\.)?relink.us/(f|((view|go).php))"
- props['version'] = "1"
- props['description'] = """Relink.us Container Plugin"""
- props['author_name'] = ("Sleeper-", "spoob")
- props['author_mail'] = ("@nonymous", "spoob@pyload.org")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
self.multi_dl = False
diff --git a/module/plugins/decrypter/SecuredIn.py b/module/plugins/crypter/SecuredIn.py
index 5ec33e5c2..5a246075f 100644
--- a/module/plugins/decrypter/SecuredIn.py
+++ b/module/plugins/crypter/SecuredIn.py
@@ -2,23 +2,22 @@
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
from module.BeautifulSoup import BeautifulSoup
from math import ceil
-class SecuredIn(Plugin):
+class SecuredIn(Crypter):
+ __name__ = "SecuredIn"
+ __type__ = "container"
+ __pattern__ = r"http://[\w\.]*?secured\.in/download-[\d]+-[\w]{8}\.html"
+ __version__ = "0.1"
+ __description__ = """secured.in Container Plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "SecuredIn"
- props['type'] = "container"
- props['pattern'] = r"http://[\w\.]*?secured\.in/download-[\d]+-[\w]{8}\.html"
- props['version'] = "0.1"
- props['description'] = """secured.in Container Plugin"""
- props['author_name'] = ("mkaay")
- props['author_mail'] = ("mkaay@mkaay.de")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
self.multi_dl = False
diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/crypter/SerienjunkiesOrg.py
index af95a9c78..af95a9c78 100644
--- a/module/plugins/decrypter/SerienjunkiesOrg.py
+++ b/module/plugins/crypter/SerienjunkiesOrg.py
diff --git a/module/plugins/decrypter/StealthTo.py b/module/plugins/crypter/StealthTo.py
index af8600274..cf7a79e9b 100644
--- a/module/plugins/decrypter/StealthTo.py
+++ b/module/plugins/crypter/StealthTo.py
@@ -3,21 +3,19 @@
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class StealthTo(Plugin):
+class StealthTo(Crypter):
+ __name__ = "StealthTo"
+ __type__ = "container"
+ __pattern__ = r"http://(www\.)?stealth.to/folder/"
+ __version__ = "0.1"
+ __description__ = """Stealth.to Container Plugin"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "StealthTo"
- props['type'] = "container"
- props['pattern'] = r"http://(www\.)?stealth.to/folder/"
- props['version'] = "0.1"
- props['description'] = """Stealth.to Container Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
diff --git a/module/plugins/decrypter/YoutubeChannel.py b/module/plugins/crypter/YoutubeChannel.py
index 497bf5853..292be06af 100644
--- a/module/plugins/decrypter/YoutubeChannel.py
+++ b/module/plugins/crypter/YoutubeChannel.py
@@ -3,21 +3,19 @@
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Crypter import Crypter
-class YoutubeChannel(Plugin):
+class YoutubeChannel(Crypter):
+ __name__ = "YoutubeChannel"
+ __type__ = "container"
+ __pattern__ = r"http://(www\.)?(de\.)?\youtube\.com/user/*"
+ __version__ = "0.9"
+ __description__ = """Youtube.com Channel Download Plugin"""
+ __author_name__ = ("RaNaN", "Spoob")
+ __author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "YoutubeChannel"
- props['type'] = "container"
- props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*"
- props['version'] = "0.9"
- props['description'] = """Youtube.com Channel Download Plugin"""
- props['author_name'] = ("RaNaN", "Spoob")
- props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org")
- self.props = props
+ Crypter.__init__(self, parent)
self.parent = parent
self.html = None
self.read_config()
diff --git a/module/plugins/decrypter/__init__.py b/module/plugins/crypter/__init__.py
index e69de29bb..e69de29bb 100644
--- a/module/plugins/decrypter/__init__.py
+++ b/module/plugins/crypter/__init__.py
diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py
index 52088bf29..adb26eab0 100644
--- a/module/plugins/hooks/ClickAndLoad.py
+++ b/module/plugins/hooks/ClickAndLoad.py
@@ -25,15 +25,11 @@ import thread
from module.plugins.Hook import Hook
class ClickAndLoad(Hook):
- def __init__(self, core):
- Hook.__init__(self, core)
- props = {}
- props['name'] = "ClickAndLoad"
- props['version'] = "0.2"
- props['description'] = """Gives abillity to use jd's click and load. depends on webinterface"""
- props['author_name'] = ("RaNaN", "mkaay")
- props['author_mail'] = ("RaNaN@pyload.de", "mkaay@mkaay.de")
- self.props = props
+ __name__ = "ClickAndLoad"
+ __version__ = "0.2"
+ __description__ = """Gives abillity to use jd's click and load. depends on webinterface"""
+ __author_name__ = ("RaNaN", "mkaay")
+ __author_mail__ = ("RaNaN@pyload.de", "mkaay@mkaay.de")
def coreReady(self):
self.port = int(self.core.config['webinterface']['port'])
diff --git a/module/plugins/hooks/ContainerDownload.py b/module/plugins/hooks/ContainerDownload.py
index f520b705c..673931391 100644
--- a/module/plugins/hooks/ContainerDownload.py
+++ b/module/plugins/hooks/ContainerDownload.py
@@ -23,15 +23,11 @@ from module.plugins.Hook import Hook
from os.path import join, abspath
class ContainerDownload(Hook):
- def __init__(self, core):
- Hook.__init__(self, core)
- props = {}
- props['name'] = "ContainerDownload"
- props['version'] = "0.1"
- props['description'] = """add the downloaded container to current package"""
- props['author_name'] = ("mkaay")
- props['author_mail'] = ("mkaay@mkaay.de")
- self.props = props
+ __name__ = "ContainerDownload"
+ __version__ = "0.1"
+ __description__ = """add the downloaded container to current package"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
def downloadFinished(self, pyfile):
filename = pyfile.status.filename
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py
index 50f6149a2..9e0f3855c 100644
--- a/module/plugins/hooks/ExternalScripts.py
+++ b/module/plugins/hooks/ExternalScripts.py
@@ -24,16 +24,14 @@ from os import listdir, sep
from os.path import join
class ExternalScripts(Hook):
+ __name__ = "ExternalScripts"
+ __version__ = "0.1"
+ __description__ = """run external scripts"""
+ __author_name__ = ("mkaay", "RaNaN", "spoob")
+ __author_mail__ = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org")
+
def __init__(self, core):
Hook.__init__(self, core)
- props = {}
- props['name'] = "ExternalScripts"
- props['version'] = "0.1"
- props['description'] = """run external scripts"""
- props['author_name'] = ("mkaay", "RaNaN", "spoob")
- props['author_mail'] = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org")
- self.props = props
- self.core = core
self.scripts = {}
script_folders = [join(core.path, 'scripts','download_preparing'),
diff --git a/module/plugins/hooks/LinuxFileEvents.py b/module/plugins/hooks/LinuxFileEvents.py
index da1b06f13..44f3f00e8 100644
--- a/module/plugins/hooks/LinuxFileEvents.py
+++ b/module/plugins/hooks/LinuxFileEvents.py
@@ -22,14 +22,15 @@ from module.plugins.Hook import Hook
import os
class LinuxFileEvents(Hook):
+ __name__ = "LinuxFileEvents"
+ __version__ = "0.1"
+ __description__ = """monitors files and directories for changes"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
def __init__(self, core):
Hook.__init__(self, core)
props = {}
- props['name'] = "LinuxFileEvents"
- props['version'] = "0.1"
- props['description'] = """monitors files and directories for changes"""
- props['author_name'] = ("mkaay")
- props['author_mail'] = ("mkaay@mkaay.de")
self.props = props
return #@TODO remove when working correctly
diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py
index b8883ac2e..f4ccf45c8 100644
--- a/module/plugins/hoster/DepositfilesCom.py
+++ b/module/plugins/hoster/DepositfilesCom.py
@@ -3,21 +3,19 @@
import re
import urllib
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class DepositfilesCom(Plugin):
+class DepositfilesCom(Hoster):
+ __name__ = "DepositfilesCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://depositfiles.com/.{2,}/files/"
+ __version__ = "0.1"
+ __description__ = """Depositfiles.com Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "DepositfilesCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://depositfiles.com/.{2,}/files/"
- props['version'] = "0.1"
- props['description'] = """Depositfiles.com Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.multi_dl = False
diff --git a/module/plugins/hoster/DuckloadCom.py b/module/plugins/hoster/DuckloadCom.py
index c64842846..34a6a5146 100644
--- a/module/plugins/hoster/DuckloadCom.py
+++ b/module/plugins/hoster/DuckloadCom.py
@@ -2,22 +2,20 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
from time import time
-class DuckloadCom(Plugin):
+class DuckloadCom(Hoster):
+ __name__ = "DuckloadCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www\.)?duckload\.com/divx/"
+ __version__ = "0.1"
+ __description__ = """Duckload.com Download Hoster"""
+ __author_name__ = ("wugy")
+ __author_mail__ = ("wugy@qip.ru")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "DuckloadCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www\.)?duckload\.com/divx/"
- props['version'] = "0.1"
- props['description'] = """Duckload.com Download Plugin"""
- props['author_name'] = ("wugy")
- props['author_mail'] = ("wugy@qip.ru")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = [None, None]
self.want_reconnect = False
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index 0a182ad78..fe68c914f 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -2,22 +2,20 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
from time import time
-class FilefactoryCom(Plugin):
+class FilefactoryCom(Hoster):
+ __name__ = "FilefactoryCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www\.)?filefactory\.com/file/"
+ __version__ = "0.1"
+ __description__ = """Filefactory.com Download Hoster"""
+ __author_name__ = ("sitacuisses","spoob","mkaay")
+ __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "FilefactoryCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www\.)?filefactory\.com/file/"
- props['version'] = "0.1"
- props['description'] = """Filefactory.com Download Plugin"""
- props['author_name'] = ("sitacuisses","spoob","mkaay")
- props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.want_reconnect = False
diff --git a/module/plugins/hoster/FilesmonsterCom.py b/module/plugins/hoster/FilesmonsterCom.py
index 7b764e63a..f52e01760 100644
--- a/module/plugins/hoster/FilesmonsterCom.py
+++ b/module/plugins/hoster/FilesmonsterCom.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Plugin for www.filesmonster.com
+# Hoster for www.filesmonster.com
# this plugin isn't fully implemented yet,but it does download
# todo:
# detect, if reconnect is necessary
@@ -13,21 +13,19 @@
import re
import urllib
import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class FilesmonsterCom(Plugin):
+class FilesmonsterCom(Hoster):
+ __name__ = "FilesmonsterCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www.)??filesmonster.com/download.php"
+ __version__ = "0.1"
+ __description__ = """Filesmonster.com Download Hoster"""
+ __author_name__ = ("sitacuisses","spoob")
+ __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "FilesmonsterCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(www.)??filesmonster.com/download.php"
- props['version'] = "0.1"
- props['description'] = """Filesmonster.com Download Plugin"""
- props['author_name'] = ("sitacuisses","spoob")
- props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.want_reconnect = False
diff --git a/module/plugins/hoster/FreakshareNet.py b/module/plugins/hoster/FreakshareNet.py
index 22b488757..e772c84c2 100644
--- a/module/plugins/hoster/FreakshareNet.py
+++ b/module/plugins/hoster/FreakshareNet.py
@@ -4,23 +4,21 @@
import re
import urllib
import httplib
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
from time import time
-class FreakshareNet(Plugin):
+class FreakshareNet(Hoster):
+ __name__ = "FreakshareNet"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www\.)?freakshare\.net/files/\S*?/"
+ __version__ = "0.1"
+ __description__ = """Freakshare.com Download Hoster"""
+ __author_name__ = ("sitacuisses","spoob","mkaay")
+ __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "FreakshareNet"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www\.)?freakshare\.net/files/\S*?/"
- props['version'] = "0.1"
- props['description'] = """Freakshare.com Download Plugin"""
- props['author_name'] = ("sitacuisses","spoob","mkaay")
- props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.want_reconnect = False
diff --git a/module/plugins/hoster/GigasizeCom.py b/module/plugins/hoster/GigasizeCom.py
index 65d59426f..38d26a404 100644
--- a/module/plugins/hoster/GigasizeCom.py
+++ b/module/plugins/hoster/GigasizeCom.py
@@ -6,21 +6,19 @@ import re
import tempfile
from time import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class GigasizeCom(Plugin):
+class GigasizeCom(Hoster):
+ __name__ = "GigasizeCom"
+ __type__ = "hoster"
+ __pattern__ = r"(?:http://)?(?:www.)?gigasize.com/get.php\?d="
+ __version__ = "0.1"
+ __description__ = """Gigasize.com Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "GigasizeCom"
- props['type'] = "hoster"
- props['pattern'] = r"(?:http://)?(?:www.)?gigasize.com/get.php\?d="
- props['version'] = "0.1"
- props['description'] = """Gigasize.com Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = [None, None]
self.want_reconnect = False
diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py
index 177e10304..a606619cd 100644
--- a/module/plugins/hoster/HotfileCom.py
+++ b/module/plugins/hoster/HotfileCom.py
@@ -3,21 +3,19 @@
import re
from time import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class HotfileCom(Plugin):
+class HotfileCom(Hoster):
+ __name__ = "HotfileCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://hotfile.com/dl/"
+ __version__ = "0.1"
+ __description__ = """Hotfile.com Download Hoster"""
+ __author_name__ = ("sitacuisses","spoob","mkaay")
+ __author_mail__ = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "HotfileCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://hotfile.com/dl/"
- props['version'] = "0.1"
- props['description'] = """Hotfile.com Download Plugin"""
- props['author_name'] = ("sitacuisses","spoob","mkaay")
- props['author_mail'] = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = [None, None]
self.want_reconnect = False
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
index 1ac21e8a7..10c3ec370 100644
--- a/module/plugins/hoster/MegauploadCom.py
+++ b/module/plugins/hoster/MegauploadCom.py
@@ -6,21 +6,19 @@ import re
import tempfile
from time import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class MegauploadCom(Plugin):
+class MegauploadCom(Hoster):
+ __name__ = "MegauploadCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www.)megaupload.com/"
+ __version__ = "0.1"
+ __description__ = """Megaupload.com Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "MegauploadCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www.)megaupload.com/"
- props['version'] = "0.1"
- props['description'] = """Megaupload.com Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.time_plus_wait = None
self.html = [None, None]
diff --git a/module/plugins/hoster/MegavideoCom.py b/module/plugins/hoster/MegavideoCom.py
index 9e6df3cc9..7ea045447 100644
--- a/module/plugins/hoster/MegavideoCom.py
+++ b/module/plugins/hoster/MegavideoCom.py
@@ -3,21 +3,20 @@
import re
from time import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
from module.unescape import unescape
-class MegavideoCom(Plugin):
+class MegavideoCom(Hoster):
+ __name__ = "MegavideoCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?megavideo.com/\?v=.*"
+ __version__ = "0.1"
+ __description__ = """Megavideo.com Download Hoster"""
+ __author_name__ = ("jeix","mkaay")
+ __author_mail__ = ("jeix@hasnomail.de","mkaay@mkaay.de")
+
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "MegavideoCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(www\.)?megavideo.com/\?v=.*"
- props['version'] = "0.1"
- props['description'] = """Megavideo.com Download Plugin"""
- props['author_name'] = ("jeix","mkaay")
- props['author_mail'] = ("jeix@hasnomail.de","mkaay@mkaay.de")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
diff --git a/module/plugins/hoster/MyvideoDe.py b/module/plugins/hoster/MyvideoDe.py
index 405cd2072..5412fd570 100644
--- a/module/plugins/hoster/MyvideoDe.py
+++ b/module/plugins/hoster/MyvideoDe.py
@@ -1,20 +1,19 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class MyvideoDe(Plugin):
+class MyvideoDe(Hoster):
+ __name__ = "MyvideoDe"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?myvideo.de/watch/"
+ __version__ = "0.9"
+ __description__ = """Myvideo.de Video Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
+
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "MyvideoDe"
- props['type'] = "hoster"
- props['pattern'] = r"http://(www\.)?myvideo.de/watch/"
- props['version'] = "0.9"
- props['description'] = """Myvideo.de Video Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.url = self.parent.url
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index bc5b437d3..c6f9da434 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -8,21 +8,19 @@ from time import time
from time import sleep
import hashlib
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class NetloadIn(Plugin):
+class NetloadIn(Hoster):
+ __name__ = "NetloadIn"
+ __type__ = "hoster"
+ __pattern__ = r"http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)"
+ __version__ = "0.1"
+ __description__ = """Netload.in Download Hoster"""
+ __author_name__ = ("spoob", "RaNaN")
+ __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "NetloadIn"
- props['type'] = "hoster"
- props['pattern'] = r"http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)"
- props['version'] = "0.1"
- props['description'] = """Netload.in Download Plugin"""
- props['author_name'] = ("spoob", "RaNaN")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = [None, None, None]
self.want_reconnect = False
diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py
index 45b078275..cfed29331 100644
--- a/module/plugins/hoster/RapidshareCom.py
+++ b/module/plugins/hoster/RapidshareCom.py
@@ -5,22 +5,20 @@
import re
from time import time
-from module.Plugin import Plugin
+from module.plugins.Hoster import Hoster
import hashlib
-class RapidshareCom(Plugin):
+class RapidshareCom(Hoster):
+ __name__ = "RapidshareCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)"
+ __version__ = "1.0"
+ __description__ = """Rapidshare.com Download Hoster"""
+ __author_name__ = ("spoob", "RaNaN", "mkaay")
+ __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "RapidshareCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)"
- props['version'] = "1.0"
- props['description'] = """Rapidshare.com Download Plugin"""
- props['author_name'] = ("spoob", "RaNaN", "mkaay")
- props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = [None, None]
self.time_plus_wait = None #time() + wait in seconds
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index 02b9d80e9..9cc0f8263 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -10,21 +10,19 @@ import hashlib
import random
from time import sleep
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class ShareonlineBiz(Plugin):
+class ShareonlineBiz(Hoster):
+ __name__ = "ShareonlineBiz"
+ __type__ = "hoster"
+ __pattern__ = r"(?:http://)?(?:www.)?share-online.biz/download.php\?id="
+ __version__ = "0.1"
+ __description__ = """Shareonline.biz Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "ShareonlineBiz"
- props['type'] = "hoster"
- props['pattern'] = r"(?:http://)?(?:www.)?share-online.biz/download.php\?id="
- props['version'] = "0.1"
- props['description'] = """Shareonline.biz Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = [None, None]
self.want_reconnect = False
diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py
index 619b63429..e634607b0 100644
--- a/module/plugins/hoster/ShragleCom.py
+++ b/module/plugins/hoster/ShragleCom.py
@@ -4,21 +4,19 @@
import re
import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class ShragleCom(Plugin):
+class ShragleCom(Hoster):
+ __name__ = "ShragleCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www.)?shragle.com/files/"
+ __version__ = "0.1"
+ __description__ = """Shragle Download PLugin"""
+ __author_name__ = ("RaNaN")
+ __author_mail__ = ("RaNaN@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "ShragleCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www.)?shragle.com/files/"
- props['version'] = "0.1"
- props['description'] = """Shragle Download PLugin"""
- props['author_name'] = ("RaNaN")
- props['author_mail'] = ("RaNaN@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.multi_dl = False
diff --git a/module/plugins/hoster/StorageTo.py b/module/plugins/hoster/StorageTo.py
index cb18cf504..d0a332baf 100644
--- a/module/plugins/hoster/StorageTo.py
+++ b/module/plugins/hoster/StorageTo.py
@@ -4,21 +4,18 @@
import re
from time import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class StorageTo(Plugin):
+class StorageTo(Hoster):
+ __name__ = "StorageTo"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www)?\.storage\.to/get/.*"
+ __version__ = "0.1"
+ __description__ = """Storage.to Download Hoster"""
+ __author_name__ = ("mkaay")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "StorageTo"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www)?\.storage\.to/get/.*"
- props['version'] = "0.1"
- props['description'] = """Storage.to Download Plugin"""
- props['author_name'] = ("mkaay")
- props['author_mail'] = ("mkaay@mkaay.de")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.time_plus_wait = None
self.want_reconnect = False
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 2cfdfb3c7..93caa39b3 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -2,22 +2,20 @@
import re
from time import time
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
import hashlib
-class UploadedTo(Plugin):
+class UploadedTo(Hoster):
+ __name__ = "UploadedTo"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/(?:file/|\?id=)?(.+)"
+ __version__ = "0.3"
+ __description__ = """Uploaded.to Download Hoster"""
+ __author_name__ = ("spoob", "mkaay")
+ __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "UploadedTo"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/(?:file/|\?id=)?(.+)"
- props['version'] = "0.3"
- props['description'] = """Uploaded.to Download Plugin"""
- props['author_name'] = ("spoob", "mkaay")
- props['author_mail'] = ("spoob@pyload.org", "mkaay@mkaay.de")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.time_plus_wait = None #time() + wait in seconds
diff --git a/module/plugins/hoster/XupIn.py b/module/plugins/hoster/XupIn.py
index 495387172..bf39990f9 100644
--- a/module/plugins/hoster/XupIn.py
+++ b/module/plugins/hoster/XupIn.py
@@ -2,21 +2,19 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class XupIn(Plugin):
+class XupIn(Hoster):
+ __name__ = "XupIn"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www.)?xup.in/"
+ __version__ = "0.1"
+ __description__ = """Xup.in Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "XupIn"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www.)?xup.in/"
- props['version'] = "0.1"
- props['description'] = """Xup.in Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.multi_dl = False
diff --git a/module/plugins/hoster/YoupornCom.py b/module/plugins/hoster/YoupornCom.py
index a32ed34a8..31e18821f 100644
--- a/module/plugins/hoster/YoupornCom.py
+++ b/module/plugins/hoster/YoupornCom.py
@@ -2,21 +2,19 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class YoupornCom(Plugin):
+class YoupornCom(Hoster):
+ __name__ = "YoupornCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?youporn\.com/watch/.+"
+ __version__ = "0.1"
+ __description__ = """Youporn.com Video Download Hoster"""
+ __author_name__ = ("willnix")
+ __author_mail__ = ("willnix@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "YoupornCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(www\.)?youporn\.com/watch/.+"
- props['version'] = "0.1"
- props['description'] = """Youporn.com Video Download Plugin"""
- props['author_name'] = ("willnix")
- props['author_mail'] = ("willnix@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.html_old = None #time() where loaded the HTML
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index 494158ba3..6c952e2ba 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -2,21 +2,19 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class YoutubeCom(Plugin):
+class YoutubeCom(Hoster):
+ __name__ = "YoutubeCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
+ __version__ = "0.2"
+ __description__ = """Youtube.com Video Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "YoutubeCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
- props['version'] = "0.2"
- props['description'] = """Youtube.com Video Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.read_config()
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index 238edeb84..fb2702ee7 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -3,21 +3,19 @@
import re
import urllib
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class ZippyshareCom(Plugin):
+class ZippyshareCom(Hoster):
+ __name__ = "ZippyshareCom"
+ __type__ = "hoster"
+ __pattern__ = r"(http://)?www?\d{0,2}\.zippyshare.com/v/"
+ __version__ = "0.1"
+ __description__ = """Zippyshare.com Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "ZippyshareCom"
- props['type'] = "hoster"
- props['pattern'] = r"(http://)?www?\d{0,2}\.zippyshare.com/v/"
- props['version'] = "0.1"
- props['description'] = """Zippyshare.com Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = None
self.want_reconnect = False
diff --git a/module/plugins/hoster/ZshareNet.py b/module/plugins/hoster/ZshareNet.py
index 1b1a50bbf..2bc75ee4e 100644
--- a/module/plugins/hoster/ZshareNet.py
+++ b/module/plugins/hoster/ZshareNet.py
@@ -2,21 +2,19 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Plugin import Plugin
+from module.plugins.Hoster import Hoster
-class ZshareNet(Plugin):
+class ZshareNet(Hoster):
+ __name__ = "ZshareNet"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www.)?zshare.net/"
+ __version__ = "0.1"
+ __description__ = """Zshare.net Download Hoster"""
+ __author_name__ = ("spoob")
+ __author_mail__ = ("spoob@pyload.org")
def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "ZshareNet"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www.)?zshare.net/"
- props['version'] = "0.1"
- props['description'] = """Zshare.net Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
+ Hoster.__init__(self, parent)
self.parent = parent
self.html = [None, None]
self.html_old = None #time() where loaded the HTML
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 8fcfa6c82..a777d4a50 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -70,6 +70,7 @@ from module.ThreadManager import ThreadManager
from module.CaptchaManager import CaptchaManager
from module.HookManager import HookManager
from module.PullEvents import PullManager
+from module.PluginManager import PluginManager
from module.FileList import FileList
class Core(object):
@@ -408,28 +409,7 @@ class Core(object):
execv(executable, [executable, "pyLoadCore.py"])
def create_plugin_index(self):
- plugins = glob(join(self.plugin_folder, "hoster", "*.py"))
- plugins += glob(join(self.plugin_folder, "decrypter", "*.py"))
- plugins += glob(join(self.plugin_folder, "container", "*.py"))
- plugins += glob(join(self.plugin_folder, "container", "DLC_*.pyc"))
- for file_handler in plugins:
- plugin_pattern = ""
- plugin_file = sub("(\.pyc|\.py)", "", basename(file_handler))
- if plugin_file.startswith("DLC"):
- if plugin_file == "DLC_25" and not version_info < (2, 6):
- continue
- if plugin_file == "DLC_26" and not version_info > (2, 6):
- continue
- plugin_pattern = "(?!http://).*\.dlc"
- else:
- for line in open(file_handler, "r").readlines():
- if "props['pattern']" in line:
- plugin_pattern = line.split("r\"")[1].split("\"")[0]
- break
- if plugin_pattern != "":
- self.plugins_avaible[plugin_file] = plugin_pattern
- self.logger.debug(_("%s added") % plugin_file)
- self.logger.info(_("created index of plugins"))
+ self.pluginManager = PluginManager(self)
def compare_time(self, start, end):