summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-22 02:59:35 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-22 02:59:35 +0200
commit014f105f6d93663bce29dbba3583fd5fff835f1b (patch)
tree181fb5e421a82bf4fe91975f503984c88c3222a2
parentUpdate XFS plugins (diff)
downloadpyload-014f105f6d93663bce29dbba3583fd5fff835f1b.tar.xz
[MultiHoster] Fix get_info
-rw-r--r--module/plugins/internal/Base.py41
-rw-r--r--module/plugins/internal/MultiHoster.py24
2 files changed, 33 insertions, 32 deletions
diff --git a/module/plugins/internal/Base.py b/module/plugins/internal/Base.py
index 1262fce15..48b4ff237 100644
--- a/module/plugins/internal/Base.py
+++ b/module/plugins/internal/Base.py
@@ -37,8 +37,8 @@ def create_getInfo(klass):
class Base(Plugin):
__name__ = "Base"
__type__ = "base"
- __version__ = "0.16"
- __status__ = "testing"
+ __version__ = "0.17"
+ __status__ = "stable"
__pattern__ = r'^unmatchable$'
__config__ = [("activated" , "bool", "Activated" , True),
@@ -52,6 +52,24 @@ class Base(Plugin):
URL_REPLACEMENTS = []
+ @classmethod
+ def get_info(cls, url="", html=""):
+ url = fixurl(url, unquote=True)
+ info = {'name' : parse_name(url),
+ 'pattern': {},
+ 'size' : 0,
+ 'status' : 3 if url else 8,
+ 'url' : replace_patterns(url, cls.URL_REPLACEMENTS)}
+
+ try:
+ info['pattern'] = re.match(cls.__pattern__, url).groupdict()
+
+ except Exception:
+ pass
+
+ return info
+
+
def __init__(self, pyfile):
self._init(pyfile.m.core)
@@ -102,23 +120,6 @@ class Base(Plugin):
'msg' : msg})
- @classmethod
- def get_info(cls, url="", html=""):
- url = fixurl(url, unquote=True)
- info = {'name' : parse_name(url),
- 'pattern': {},
- 'size' : 0,
- 'status' : 3 if url else 8,
- 'url' : replace_patterns(url, cls.URL_REPLACEMENTS)}
-
- try:
- info['pattern'] = re.match(cls.__pattern__, url).groupdict()
- except Exception:
- pass
-
- return info
-
-
def init_base(self):
pass
@@ -158,8 +159,8 @@ class Base(Plugin):
self.req = self.pyload.requestFactory.getRequest(self.classname)
self.premium = False
- self.grab_info()
self.setup_base()
+ self.grab_info()
self.setup()
diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py
index 82e2f81c5..d50b82ce0 100644
--- a/module/plugins/internal/MultiHoster.py
+++ b/module/plugins/internal/MultiHoster.py
@@ -9,8 +9,8 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, r
class MultiHoster(SimpleHoster):
__name__ = "MultiHoster"
__type__ = "hoster"
- __version__ = "0.56"
- __status__ = "testing"
+ __version__ = "0.57"
+ __status__ = "stable"
__pattern__ = r'^unmatchable$'
__config__ = [("activated" , "bool", "Activated" , True),
@@ -45,23 +45,23 @@ class MultiHoster(SimpleHoster):
self.resume_download = self.premium
- def prepare(self):
- #@TODO: Recheck in 0.4.10
+ #@TODO: Recheck in 0.4.10
+ def setup_base(self):
plugin = self.pyload.pluginManager.hosterPlugins[self.classname]
- name = plugin['name']
- module = plugin['module']
- klass = getattr(module, name)
+ klass = getattr(plugin['module'], plugin['name'])
self.get_info = klass.get_info
- if self.DIRECT_LINK is None:
- direct_dl = self.__pattern__ != r'^unmatchable$' and re.match(self.__pattern__, self.pyfile.url)
- else:
- direct_dl = self.DIRECT_LINK
+ super(MultiHoster, self).setup_base()
+
+ def prepare(self):
super(MultiHoster, self).prepare()
- self.direct_dl = direct_dl
+ if self.DIRECT_LINK is None:
+ self.direct_dl = self.__pattern__ != r'^unmatchable$' and re.match(self.__pattern__, self.pyfile.url)
+ else:
+ self.direct_dl = self.DIRECT_LINK
def _process(self, thread):