summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-27 14:46:23 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-27 14:46:23 +0100
commitd93d7de59b219ef55aea98f0da00690753fe7afe (patch)
tree0b59bc1de0e90c9bf2c56c71f6b92deea0cee699 /module/plugins/hoster
parentMerge pull request #683 from synweap15/nopremium (diff)
parentAdded support for Multihosters.com multihoster. (diff)
downloadpyload-d93d7de59b219ef55aea98f0da00690753fe7afe.tar.xz
Merge pull request #698 from tjeh/stable
Added support for Multihosters.com multihoster.
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/MultihostersCom.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/module/plugins/hoster/MultihostersCom.py b/module/plugins/hoster/MultihostersCom.py
new file mode 100644
index 000000000..04192cd8e
--- /dev/null
+++ b/module/plugins/hoster/MultihostersCom.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+
+import re
+from module.plugins.Hoster import Hoster
+
+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
+
+ 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)
+
+ 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")