summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/ZeveraCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/ZeveraCom.py')
-rw-r--r--module/plugins/hoster/ZeveraCom.py44
1 files changed, 18 insertions, 26 deletions
diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py
index 93959637c..665b64789 100644
--- a/module/plugins/hoster/ZeveraCom.py
+++ b/module/plugins/hoster/ZeveraCom.py
@@ -1,42 +1,34 @@
# -*- coding: utf-8 -*-
-from pyload.plugin.Hoster import Hoster
+import re
+from urlparse import urljoin
-class ZeveraCom(Hoster):
+from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
+
+
+class ZeveraCom(MultiHoster):
__name__ = "ZeveraCom"
__type__ = "hoster"
- __version__ = "0.21"
+ __version__ = "0.28"
- __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 setup(self):
- self.resumeDownload = True
- self.multiDL = True
- self.chunkLimit = 1
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
- def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "zevera.com")
- self.fail(_("No zevera.com account provided"))
+ def handlePremium(self, pyfile):
+ self.link = "https://%s/getFiles.ashx?ourl=%s" % (self.account.HOSTER_DOMAIN, pyfile.url)
- self.logDebug("Old URL: %s" % pyfile.url)
- if self.account.getAPIData(self.req, cmd="checklink", olink=pyfile.url) != "Alive":
- self.fail(_("Offline or not downloadable - contact Zevera support"))
+ def checkFile(self):
+ if self.checkDownload({"error": 'action="ErrorDownload.aspx'}):
+ self.fail(_("Error response received"))
- header = self.account.getAPIData(self.req, just_header=True, cmd="generatedownloaddirect", olink=pyfile.url)
- if not "location" in header:
- self.fail(_("Unable to initialize download"))
+ return super(ZeveraCom, self).checkFile()
- self.download(header['location'], disposition=True)
- check = self.checkDownload({"error": 'action="ErrorDownload.aspx'})
- if check == "error":
- self.fail(_("Error response received - contact Zevera support"))
+getInfo = create_getInfo(ZeveraCom)