diff options
Diffstat (limited to 'pyload/plugins/account/PremiumizeMe.py')
-rw-r--r-- | pyload/plugins/account/PremiumizeMe.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pyload/plugins/account/PremiumizeMe.py b/pyload/plugins/account/PremiumizeMe.py index ebc488226..4071e0ad2 100644 --- a/pyload/plugins/account/PremiumizeMe.py +++ b/pyload/plugins/account/PremiumizeMe.py @@ -6,12 +6,13 @@ from pyload.utils import json_loads class PremiumizeMe(Account): - __name__ = "PremiumizeMe" - __type__ = "account" + __name__ = "PremiumizeMe" + __type__ = "account" __version__ = "0.11" __description__ = """Premiumize.me account plugin""" - __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] def loadAccountInfo(self, user, req): @@ -21,13 +22,14 @@ class PremiumizeMe(Account): # Parse account info account_info = {"validuntil": float(status['result']['expires']), - "trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)} + "trafficleft": max(0, status['result']['trafficleft_bytes'])} if status['result']['type'] == 'free': account_info['premium'] = False return account_info + def login(self, user, data, req): # Get user data from premiumize.me status = self.getAccountStatus(user, req) @@ -36,6 +38,7 @@ class PremiumizeMe(Account): if status['status'] != 200: self.wrongPassword() + def getAccountStatus(self, user, req): # Use premiumize.me API v1 (see https://secure.premiumize.me/?show=api) # to retrieve account info and return the parsed json answer |