diff options
Diffstat (limited to 'module/plugins/hoster/ZeveraCom.py')
-rw-r--r-- | module/plugins/hoster/ZeveraCom.py | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index 60fc2a12b..83ff16357 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/plugins/hoster/ZeveraCom.py @@ -1,36 +1,39 @@ # -*- coding: utf-8 -*- +import re + +from urlparse import urljoin + from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" __type__ = "hoster" - __version__ = "0.25" + __version__ = "0.26" - __pattern__ = r'http://(?:www\.)?zevera\.com/.+' + __pattern__ = r'https?://(?:www\.)zevera\.com/(getFiles\.ashx|Members/download\.ashx)\?.*ourl=.+' - __description__ = """Zevera.com hoster plugin""" + __description__ = """Zevera.com multi-hoster plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - - def handlePremium(self): - if self.account.getAPIData(self.req, cmd="checklink", olink=self.pyfile.url) != "Alive": - self.fail(_("Offline or not downloadable")) + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] - header = self.account.getAPIData(self.req, just_header=True, cmd="generatedownloaddirect", olink=self.pyfile.url) - if not "location" in header: - self.fail(_("Unable to initialize download")) - self.link = header['location'] + def handlePremium(self, pyfile): + html = self.account.api_response(self.req, cmd="checklink", olink=pyfile.url) + if "Alive" in html: + header = self.account.api_response(self.req, just_header=True, cmd="generatedownloaddirect", olink=pyfile.url) + self.link = self.directLink(header['location']) + else: + self.fail(re.search(r'Error: (.+)', html).group(1)) def checkFile(self): - super(ZeveraCom, self).checkFile() + if self.checkDownload({"error": 'action="ErrorDownload.aspx'}): + self.fail(_("Error response received")) - if self.checkDownload({"error": 'action="ErrorDownload.aspx'}) is "error": - self.fail(_("Error response received - contact Zevera support")) + return super(ZeveraCom, self).checkFile() getInfo = create_getInfo(ZeveraCom) |