summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/MultihostersCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-09 00:35:51 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-09 00:35:51 +0100
commitfd105f8e51768ec1943cda2375bdfdbe5b0a3951 (patch)
treeccbdbe3cd23c606e8102f11ae4e0722f7e7a3227 /module/plugins/hoster/MultihostersCom.py
parent"New Year" Update: hook plugins (diff)
downloadpyload-fd105f8e51768ec1943cda2375bdfdbe5b0a3951.tar.xz
"New Year" Update: hoster plugins
Diffstat (limited to 'module/plugins/hoster/MultihostersCom.py')
-rw-r--r--module/plugins/hoster/MultihostersCom.py44
1 files changed, 9 insertions, 35 deletions
diff --git a/module/plugins/hoster/MultihostersCom.py b/module/plugins/hoster/MultihostersCom.py
index 04192cd8e..c5a48310e 100644
--- a/module/plugins/hoster/MultihostersCom.py
+++ b/module/plugins/hoster/MultihostersCom.py
@@ -1,41 +1,15 @@
# -*- coding: utf-8 -*-
-import re
-from module.plugins.Hoster import Hoster
+from module.plugins.hosters.ZeveraCom import ZeveraCom
-class MultihostersCom(Hoster):
- __name__ = "MultihostersCom"
- __version__ = "0.01"
- __type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?multihosters.com/.*'
- __description__ = """Multihosters.com hoster plugin"""
- __author_name__ = "tjeh"
- __author_mail__ = "tjeh@gmx.net"
- def setup(self):
- self.resumeDownload = self.multiDL = True
- self.chunkLimit = 1
+class MultihostersCom(ZeveraCom):
+ __name__ = "MultihostersCom"
+ __type__ = "hoster"
+ __version__ = "0.02"
- def process(self, pyfile):
- if re.match(self.__pattern__, pyfile.url):
- new_url = pyfile.url
- elif not self.account:
- self.logError(("Please enter your %s account or deactivate this plugin") % "multihosters.com")
- self.fail("No multihosters.com account provided")
- else:
- self.logDebug("Old URL: %s" % pyfile.url)
- new_url = "http://multihosters.com/getFiles.aspx?ourl=" + pyfile.url
- pyfile.url = new_url
- self.logDebug("New URL: %s" % new_url)
+ __pattern__ = r'https?://(?:www\.)multihosters\.com/(getFiles\.ashx|Members/download\.ashx)\?.*ourl=.+'
- if self.account.getAPIData(self.req, cmd="checklink", olink=pyfile.url) != "Alive":
- self.fail("Offline or not downloadable - contact Multihosters support")
-
- 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 - contact Multihosters support")
- self.download(header['location'], disposition=True)
-
- check = self.checkDownload({"error": 'action="ErrorDownload.aspx'})
- if check == "error":
- self.fail("Error response received - contact Multihosters support")
+ __description__ = """Multihosters.com multi-hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("tjeh", "tjeh@gmx.net")]