diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-13 15:56:57 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-13 15:56:57 +0100 |
commit | acc46fc3497a66a427b795b4a22c6e71d69185a1 (patch) | |
tree | 2d315b838a76435fc456b972c99c28d1732b2f70 /pyload/plugins/account/PremiumizeMe.py | |
parent | Code fixes (diff) | |
download | pyload-acc46fc3497a66a427b795b4a22c6e71d69185a1.tar.xz |
Update
Diffstat (limited to 'pyload/plugins/account/PremiumizeMe.py')
-rw-r--r-- | pyload/plugins/account/PremiumizeMe.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/pyload/plugins/account/PremiumizeMe.py b/pyload/plugins/account/PremiumizeMe.py deleted file mode 100644 index 96dd67b98..000000000 --- a/pyload/plugins/account/PremiumizeMe.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugins.Account import Account - -from pyload.utils import json_loads - - -class PremiumizeMe(Account): - __name = "PremiumizeMe" - __type = "account" - __version = "0.11" - - __description = """Premiumize.me account plugin""" - __license = "GPLv3" - __authors = [("Florian Franzen", "FlorianFranzen@gmail.com")] - - - def loadAccountInfo(self, user, req): - # Get user data from premiumize.me - status = self.getAccountStatus(user, req) - self.logDebug(status) - - # Parse account info - account_info = {"validuntil": float(status['result']['expires']), - "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) - - # Check if user and password are valid - 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 - answer = req.load("https://api.premiumize.me/pm-api/v1.php", - get={'method' : "accountstatus", - 'params[login]': user, - 'params[pass]' : self.accounts[user]['password']}) - return json_loads(answer) |