diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 21:59:10 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 21:59:10 +0100 |
commit | 8e7d14bae4d3c836f029a1235eb227380acc3f75 (patch) | |
tree | ebd0679642cccb994e70a89a106b394189cb28bc /module/plugins/accounts/SimplyPremiumCom.py | |
parent | Merge branch 'stable' into 0.4.10 (diff) | |
download | pyload-8e7d14bae4d3c836f029a1235eb227380acc3f75.tar.xz |
Fix plugins to work on 0.4.10
Diffstat (limited to 'module/plugins/accounts/SimplyPremiumCom.py')
-rw-r--r-- | module/plugins/accounts/SimplyPremiumCom.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py deleted file mode 100644 index 298ad8d59..000000000 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from pyload.plugin.Account import Account - - -class SimplyPremiumCom(Account): - __name__ = "SimplyPremiumCom" - __type__ = "account" - __version__ = "0.05" - - __description__ = """Simply-Premium.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - - - def loadAccountInfo(self, user, req): - premium = False - validuntil = -1 - trafficleft = None - - json_data = req.load('http://www.simply-premium.com/api/user.php?format=json') - - self.logDebug("JSON data: %s" % json_data) - - json_data = json_loads(json_data) - - if 'vip' in json_data['result'] and json_data['result']['vip']: - premium = True - - if 'timeend' in json_data['result'] and json_data['result']['timeend']: - validuntil = float(json_data['result']['timeend']) - - if 'remain_traffic' in json_data['result'] and json_data['result']['remain_traffic']: - trafficleft = float(json_data['result']['remain_traffic']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 - - return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft} - - - def login(self, user, data, req): - req.cj.setCookie("simply-premium.com", "lang", "EN") - - html = req.load("http://www.simply-premium.com/login.php", - post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, - decode=True) - - if 'logout' not in html: - self.wrongPassword() |