summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/MultihostersCom.py
diff options
context:
space:
mode:
authorGravatar Sahil Shekhawat <sahilshekhawat01@gmail.com> 2015-01-11 14:54:48 +0100
committerGravatar Sahil Shekhawat <sahilshekhawat01@gmail.com> 2015-01-11 14:54:48 +0100
commitd2b60b5ceb369814a0de41c8b8744b5c4ed81523 (patch)
tree6619e01fc0e5f281e4d28678ec565860a86784ec /module/plugins/accounts/MultihostersCom.py
parentupdated nitroflare.com's plugin (diff)
parentCode improvements (diff)
downloadpyload-d2b60b5ceb369814a0de41c8b8744b5c4ed81523.tar.xz
Merged with the updated nitroflare
Diffstat (limited to 'module/plugins/accounts/MultihostersCom.py')
-rw-r--r--module/plugins/accounts/MultihostersCom.py52
1 files changed, 9 insertions, 43 deletions
diff --git a/module/plugins/accounts/MultihostersCom.py b/module/plugins/accounts/MultihostersCom.py
index 3f96fdf41..e98f17b2d 100644
--- a/module/plugins/accounts/MultihostersCom.py
+++ b/module/plugins/accounts/MultihostersCom.py
@@ -1,50 +1,16 @@
# -*- coding: utf-8 -*-
-from time import mktime, strptime
-from module.plugins.Account import Account
+from module.plugins.accounts.ZeveraCom import ZeveraCom
-class MultihostersCom(Account):
- __name__ = "MultihostersCom"
- __version__ = "0.01"
- __type__ = "account"
- __description__ = """Multihosters.com account plugin"""
- __author_name__ = "tjeh"
- __author_mail__ = "tjeh@gmx.net"
-
- def loadAccountInfo(self, user, req):
- data = self.getAPIData(req)
- if data == "No traffic":
- account_info = {"trafficleft": 0, "validuntil": 0, "premium": False}
- else:
- account_info = {
- "trafficleft": int(data['availabletodaytraffic']) * 1024,
- "validuntil": mktime(strptime(data['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")),
- "premium": True
- }
- return account_info
- def login(self, user, data, req):
- self.loginname = user
- self.password = data['password']
- if self.getAPIData(req) == "No traffic":
- self.wrongPassword()
+class MultihostersCom(ZeveraCom):
+ __name__ = "MultihostersCom"
+ __type__ = "account"
+ __version__ = "0.03"
- def getAPIData(self, req, just_header=False, **kwargs):
- get_data = {
- 'cmd': 'accountinfo',
- 'login': self.loginname,
- 'pass': self.password
- }
- get_data.update(kwargs)
+ __description__ = """Multihosters.com account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("tjeh", "tjeh@gmx.net")]
- response = req.load("http://www.multihosters.com/jDownloader.ashx", get=get_data,
- decode=True, just_header=just_header)
- self.logDebug(response)
- if ':' in response:
- if not just_header:
- response = response.replace(',', '\n')
- return dict((y.strip().lower(), z.strip()) for (y, z) in
- [x.split(':', 1) for x in response.splitlines() if ':' in x])
- else:
- return response
+ HOSTER_DOMAIN = "multihosters.com"