summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-18 11:50:43 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-18 11:50:43 +0200
commit339b2e07d78b15ca014ee12f1501cdb235d9b064 (patch)
tree98964f4fe5ef2d9b584a5de291d4ff719903a836 /module/plugins/internal
parent[XFSHoster] Fix https://github.com/pyload/pyload/issues/1296 (diff)
downloadpyload-339b2e07d78b15ca014ee12f1501cdb235d9b064.tar.xz
[SimpleHoster] Fix create_getInfo
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/DeadCrypter.py6
-rw-r--r--module/plugins/internal/DeadHoster.py6
-rw-r--r--module/plugins/internal/SimpleHoster.py30
3 files changed, 15 insertions, 27 deletions
diff --git a/module/plugins/internal/DeadCrypter.py b/module/plugins/internal/DeadCrypter.py
index 866d177cf..c93447164 100644
--- a/module/plugins/internal/DeadCrypter.py
+++ b/module/plugins/internal/DeadCrypter.py
@@ -7,7 +7,7 @@ from module.plugins.Crypter import Crypter as _Crypter
class DeadCrypter(_Crypter):
__name__ = "DeadCrypter"
__type__ = "crypter"
- __version__ = "0.04"
+ __version__ = "0.05"
__pattern__ = r'^unmatchable$'
@@ -17,8 +17,8 @@ class DeadCrypter(_Crypter):
@classmethod
- def apiInfo(cls, url="", get={}, post={}):
- api = super(DeadCrypter, self).apiInfo(url, get, post)
+ def apiInfo(cls, url):
+ api = super(DeadCrypter, cls).apiInfo(url)
api['status'] = 1
return api
diff --git a/module/plugins/internal/DeadHoster.py b/module/plugins/internal/DeadHoster.py
index a6ad92607..f159ae5fa 100644
--- a/module/plugins/internal/DeadHoster.py
+++ b/module/plugins/internal/DeadHoster.py
@@ -7,7 +7,7 @@ from module.plugins.Hoster import Hoster as _Hoster
class DeadHoster(_Hoster):
__name__ = "DeadHoster"
__type__ = "hoster"
- __version__ = "0.14"
+ __version__ = "0.15"
__pattern__ = r'^unmatchable$'
@@ -17,8 +17,8 @@ class DeadHoster(_Hoster):
@classmethod
- def apiInfo(cls, url="", get={}, post={}):
- api = super(DeadHoster, self).apiInfo(url, get, post)
+ def apiInfo(cls, url):
+ api = super(DeadHoster, cls).apiInfo(url)
api['status'] = 1
return api
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 9303bcf2e..aae3bac8c 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -100,7 +100,7 @@ def parseHtmlForm(attr_str, html, input_names={}):
return {}, None #: no matching form found
-#: Deprecated
+#@TODO: Remove in 0.4.10
def parseFileInfo(plugin, url="", html=""):
if hasattr(plugin, "getInfo"):
info = plugin.getInfo(url, html)
@@ -119,19 +119,14 @@ def parseFileInfo(plugin, url="", html=""):
#@TODO: Remove in 0.4.10
-#@NOTE: Every plugin must have own parseInfos classmethod to work with 0.4.10
def create_getInfo(plugin):
+ def getInfo(urls):
+ for url in urls:
+ if hasattr(plugin, "URL_REPLACEMENTS"):
+ url = replace_patterns(url, plugin.URL_REPLACEMENTS)
+ yield parseFileInfo(plugin, url)
- def generator(list):
- for x in list:
- yield x
-
- if hasattr(plugin, "parseInfos"):
- fn = lambda urls: generator((info['name'], info['size'], info['status'], info['url']) for info in plugin.parseInfos(urls))
- else:
- fn = lambda urls: generator(parseFileInfo(url) for url in urls)
-
- return fn
+ return getInfo
def timestamp():
@@ -244,7 +239,7 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "1.44"
+ __version__ = "1.45"
__pattern__ = r'^unmatchable$'
__config__ = [("use_premium", "bool", "Use premium account if available" , True),
@@ -325,14 +320,7 @@ class SimpleHoster(Hoster):
@classmethod
- def parseInfos(cls, urls): #@TODO: Built-in in 0.4.10 core (remove from plugins)
- for url in urls:
- url = replace_patterns(url, cls.URL_REPLACEMENTS)
- yield cls.getInfo(url)
-
-
- @classmethod
- def apiInfo(cls, url="", get={}, post={}):
+ def apiInfo(cls, url):
url = urllib.unquote(url)
url_p = urlparse.urlparse(url)
return {'name' : (url_p.path.split('/')[-1]