summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-06 11:03:57 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-06 11:03:57 +0100
commitef0d8692b04d75f4a39a565d52c2eb381eb43055 (patch)
tree9fb77ead91f0fe058058cda054c506566e8a9c2d
parent[XFileSharingPro] Improve regexp (diff)
downloadpyload-ef0d8692b04d75f4a39a565d52c2eb381eb43055.tar.xz
[SimpleHoster] Fix multihost
-rw-r--r--module/plugins/internal/SimpleHoster.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index f391445fd..530b67692 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -144,7 +144,7 @@ def _isDirectLink(self, url, resumable=True):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "0.70"
+ __version__ = "0.71"
__pattern__ = r'^unmatchable$'
@@ -319,8 +319,8 @@ class SimpleHoster(Hoster):
set_cookies(self.req.cj, self.COOKIES)
if (self.MULTI_HOSTER
- and self.__pattern__ != self.core.pluginManager.hosterPlugins[self.__name__]['pattern']
- and re.match(self.__pattern__, self.pyfile.url) is None):
+ and (self.__pattern__ != self.core.pluginManager.hosterPlugins[self.__name__]['pattern']
+ or re.match(self.__pattern__, self.pyfile.url) is None)):
self.logInfo("Multi hoster detected")
@@ -384,12 +384,17 @@ class SimpleHoster(Hoster):
self.logDebug("Handled as free download")
self.handleFree()
- if self.link:
- self.download(self.link, disposition=self.CONTENT_DISPOSITION)
-
+ self.downloadLink(self.link)
self.checkFile()
+ def downloadLink(self, link):
+ if not link:
+ return
+
+ self.download(link, disposition=self.CONTENT_DISPOSITION)
+
+
def checkFile(self):
if self.checkDownload({'empty': re.compile(r"^$")}) is "empty": #@TODO: Move to hoster in 0.4.10
self.fail(_("Empty file"))