diff options
author | 2015-08-09 00:50:54 +0200 | |
---|---|---|
committer | 2015-08-09 00:50:54 +0200 | |
commit | b0ef3f1673e1930916604bb1264ca3a38414bc8d (patch) | |
tree | c97936e4d2a4cd6eb1072c65c8a08a7d18816b18 /module/plugins/accounts/OverLoadMe.py | |
parent | [XFileSharingPro][XFileSharingProFolder] Added default __pattern__ (diff) | |
parent | Fix https://github.com/pyload/pyload/issues/1707 (diff) | |
download | pyload-b0ef3f1673e1930916604bb1264ca3a38414bc8d.tar.xz |
Merge pull request #1 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/accounts/OverLoadMe.py')
-rw-r--r-- | module/plugins/accounts/OverLoadMe.py | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index 64d04aded..6741b674f 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -1,43 +1,42 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class OverLoadMe(Account): __name__ = "OverLoadMe" __type__ = "account" - __version__ = "0.04" + __version__ = "0.06" + __status__ = "testing" __description__ = """Over-Load.me account plugin""" __license__ = "GPLv3" __authors__ = [("marley", "marley@over-load.me")] - def loadAccountInfo(self, user, req): - https = "https" if self.getConfig('ssl') else "http" - data = self.getAccountData(user) - html = req.load(https + "://api.over-load.me/account.php", - get={'user': user, - 'auth': data['password']}).strip() + def parse_info(self, user, password, data, req): + data = self.get_data(user) + html = self.load("https://api.over-load.me/account.php", + get={'user': user, + 'auth': password}).strip() data = json_loads(html) - self.logDebug(data) + self.log_debug(data) - # Check for premium + #: Check for premium if data['membership'] == "Free": return {'premium': False, 'validuntil': None, 'trafficleft': None} else: return {'premium': True, 'validuntil': data['expirationunix'], 'trafficleft': -1} - def login(self, user, data, req): - https = "https" if self.getConfig('ssl') else "http" - jsondata = req.load(https + "://api.over-load.me/account.php", - get={'user': user, - 'auth': data['password']}).strip() + def login(self, user, password, data, req): + jsondata = self.load("https://api.over-load.me/account.php", + get={'user': user, + 'auth': password}).strip() data = json_loads(jsondata) if data['err'] == 1: - self.wrongPassword() + self.login_fail() |