summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/account/RPNetBiz.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/account/RPNetBiz.py')
-rw-r--r--pyload/plugins/account/RPNetBiz.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/pyload/plugins/account/RPNetBiz.py b/pyload/plugins/account/RPNetBiz.py
index 6cd6b6d76..442355a8c 100644
--- a/pyload/plugins/account/RPNetBiz.py
+++ b/pyload/plugins/account/RPNetBiz.py
@@ -5,21 +5,22 @@ from pyload.utils import json_loads
class RPNetBiz(Account):
- __name__ = "RPNetBiz"
- __type__ = "account"
+ __name__ = "RPNetBiz"
+ __type__ = "account"
__version__ = "0.1"
__description__ = """RPNet.biz account plugin"""
- __authors__ = [("Dman", "dmanugm@gmail.com")]
+ __license__ = "GPLv3"
+ __authors__ = [("Dman", "dmanugm@gmail.com")]
def loadAccountInfo(self, user, req):
# Get account information from rpnet.biz
- response = self.getAccountStatus(user, req)
+ res = self.getAccountStatus(user, req)
try:
- if response['accountInfo']['isPremium']:
+ if res['accountInfo']['isPremium']:
# Parse account info. Change the trafficleft later to support per host info.
- account_info = {"validuntil": int(response['accountInfo']['premiumExpiry']),
+ account_info = {"validuntil": int(res['accountInfo']['premiumExpiry']),
"trafficleft": -1, "premium": True}
else:
account_info = {"validuntil": None, "trafficleft": None, "premium": False}
@@ -30,19 +31,21 @@ class RPNetBiz(Account):
return account_info
+
def login(self, user, data, req):
# Get account information from rpnet.biz
- response = self.getAccountStatus(user, req)
+ res = self.getAccountStatus(user, req)
- # If we have an error in the response, we have wrong login information
- if 'error' in response:
+ # If we have an error in the res, we have wrong login information
+ if 'error' in res:
self.wrongPassword()
+
def getAccountStatus(self, user, req):
# Using the rpnet API, check if valid premium account
- response = req.load("https://premium.rpnet.biz/client_api.php",
+ res = req.load("https://premium.rpnet.biz/client_api.php",
get={"username": user, "password": self.accounts[user]['password'],
"action": "showAccountInformation"})
- self.logDebug("JSON data: %s" % response)
+ self.logDebug("JSON data: %s" % res)
- return json_loads(response)
+ return json_loads(res)