summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-23 01:30:45 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-23 01:30:45 +0100
commit9804b57e02d663328af048a96e60a330ac27b60d (patch)
treebd71d62e8a3ea37154e36eb75ed72bb0cc4982b2 /module/plugins
parent[BasePlugin] Improve a bit (diff)
downloadpyload-9804b57e02d663328af048a96e60a330ac27b60d.tar.xz
Fixes about create_getInfo
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/internal/DeadCrypter.py13
-rw-r--r--module/plugins/internal/DeadHoster.py21
-rw-r--r--module/plugins/internal/SimpleCrypter.py4
-rw-r--r--module/plugins/internal/SimpleHoster.py5
-rw-r--r--module/plugins/internal/XFSHoster.py4
5 files changed, 31 insertions, 16 deletions
diff --git a/module/plugins/internal/DeadCrypter.py b/module/plugins/internal/DeadCrypter.py
index 4c635e366..c721c8390 100644
--- a/module/plugins/internal/DeadCrypter.py
+++ b/module/plugins/internal/DeadCrypter.py
@@ -1,12 +1,15 @@
# -*- coding: utf-8 -*-
+from urlparse import urlparse
+
+from module.plugins.internal.SimpleCrypter import create_getInfo
from module.plugins.Crypter import Crypter as _Crypter
class DeadCrypter(_Crypter):
__name__ = "DeadCrypter"
__type__ = "crypter"
- __version__ = "0.02"
+ __version__ = "0.03"
__pattern__ = r'^unmatchable$'
@@ -15,6 +18,14 @@ class DeadCrypter(_Crypter):
__authors__ = [("stickell", "l.stickell@yahoo.it")]
+ @classmethod
+ def getInfo(cls, url="", html=""):
+ return {'name': urlparse(url).path.split('/')[-1] or _("Unknown"), 'size': 0, 'status': 1, 'url': url or ""}
+
+
def setup(self):
self.pyfile.error = "Crypter is no longer available"
self.offline() #@TODO: self.offline("Crypter is no longer available")
+
+
+getInfo = create_getInfo(DeadCrypter)
diff --git a/module/plugins/internal/DeadHoster.py b/module/plugins/internal/DeadHoster.py
index b78068069..b85aea3f9 100644
--- a/module/plugins/internal/DeadHoster.py
+++ b/module/plugins/internal/DeadHoster.py
@@ -1,20 +1,15 @@
# -*- coding: utf-8 -*-
-from module.plugins.Hoster import Hoster as _Hoster
-
-
-def create_getInfo(plugin):
+from urlparse import urlparse
- def getInfo(urls):
- yield map(lambda url: ('#N/A: ' + url, 0, 1, url), urls)
-
- return getInfo
+from module.plugins.internal.SimpleHoster import create_getInfo
+from module.plugins.Hoster import Hoster as _Hoster
class DeadHoster(_Hoster):
__name__ = "DeadHoster"
__type__ = "hoster"
- __version__ = "0.12"
+ __version__ = "0.13"
__pattern__ = r'^unmatchable$'
@@ -23,6 +18,14 @@ class DeadHoster(_Hoster):
__authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
+ @classmethod
+ def getInfo(cls, url="", html=""):
+ return {'name': urlparse(url).path.split('/')[-1] or _("Unknown"), 'size': 0, 'status': 1, 'url': url or ""}
+
+
def setup(self):
self.pyfile.error = "Hoster is no longer available"
self.offline() #@TODO: self.offline("Hoster is no longer available")
+
+
+getInfo = create_getInfo(DeadHoster)
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index 5d00daa3c..53ffaf4a6 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -5,14 +5,14 @@ import re
from urlparse import urlparse
from module.plugins.Crypter import Crypter
-from module.plugins.internal.SimpleHoster import SimpleHoster, replace_patterns, set_cookies
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns, set_cookies
from module.utils import fixup
class SimpleCrypter(Crypter, SimpleHoster):
__name__ = "SimpleCrypter"
__type__ = "crypter"
- __version__ = "0.31"
+ __version__ = "0.32"
__pattern__ = r'^unmatchable$'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config['general']['folder_per_package']
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index ea298cc39..01702d423 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -100,6 +100,7 @@ def parseFileInfo(plugin, url="", html=""):
#@TODO: Remove in 0.4.10
+#@NOTE: Every plugin must have own parseInfo classmethod to work with 0.4.10
def create_getInfo(plugin):
return lambda urls: [(info['name'], info['size'], info['status'], info['url']) for info in plugin.parseInfo(urls)]
@@ -126,7 +127,7 @@ def _getDirectLink(self, url):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "0.60"
+ __version__ = "0.61"
__pattern__ = r'^unmatchable$'
@@ -197,7 +198,7 @@ class SimpleHoster(Hoster):
@classmethod
def getInfo(cls, url="", html=""):
- info = {'name': url or _("Unknown"), 'size': 0, 'status': 3, 'url': url}
+ info = {'name': urlparse(url).path.split('/')[-1] or _("Unknown"), 'size': 0, 'status': 3, 'url': url or ""}
if not html:
if url:
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py
index d5bbf5c63..2cc4833e6 100644
--- a/module/plugins/internal/XFSHoster.py
+++ b/module/plugins/internal/XFSHoster.py
@@ -16,7 +16,7 @@ from module.utils import html_unescape
class XFSHoster(SimpleHoster):
__name__ = "XFSHoster"
__type__ = "hoster"
- __version__ = "0.22"
+ __version__ = "0.23"
__pattern__ = r'^unmatchable$'
@@ -108,7 +108,7 @@ class XFSHoster(SimpleHoster):
def getDownloadLink(self):
- for i in xrange(1, 5):
+ for i in xrange(1, 6):
self.logDebug("Getting download link: #%d" % i)
self.checkErrors()