diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-06 11:03:57 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-06 11:03:57 +0100 |
commit | ef0d8692b04d75f4a39a565d52c2eb381eb43055 (patch) | |
tree | 9fb77ead91f0fe058058cda054c506566e8a9c2d /module/plugins/internal/SimpleHoster.py | |
parent | [XFileSharingPro] Improve regexp (diff) | |
download | pyload-ef0d8692b04d75f4a39a565d52c2eb381eb43055.tar.xz |
[SimpleHoster] Fix multihost
Diffstat (limited to 'module/plugins/internal/SimpleHoster.py')
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 17 |
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")) |