diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-28 22:14:45 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-28 22:14:45 +0100 |
commit | 749adf8ccfec097b78d4926a48adbcc96ad267cd (patch) | |
tree | 61ee7d6173abb66ffa55b8c6c75ba4b54233ecbf /module/plugins/accounts | |
parent | Merge pull request #1087 from grapemix/stable (diff) | |
download | pyload-749adf8ccfec097b78d4926a48adbcc96ad267cd.tar.xz |
[RapidgatorNet] Fix account sid
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/RapidgatorNet.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 5a321fcf9..a7aa6ce09 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class RapidgatorNet(Account): __name__ = "RapidgatorNet" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Rapidgator.net account plugin""" __license__ = "GPLv3" @@ -18,8 +18,13 @@ class RapidgatorNet(Account): def loadAccountInfo(self, user, req): + validuntil = None + trafficleft = None + premium = False + sid = None + try: - sid = self.getAccountData(user).get('SID') + sid = self.getAccountData(user).get('sid') assert sid json = req.load("%s/info?sid=%s" % (self.API_URL, sid)) @@ -30,15 +35,19 @@ class RapidgatorNet(Account): if "reset_in" in json['response']: self.scheduleRefresh(user, json['response']['reset_in']) - return {"validuntil": json['response']['expire_date'], - "trafficleft": float(json['response']['traffic_left']) / 1024, #@TODO: Remove `/ 1024` in 0.4.10 - "premium": True, "SID": sid} + validuntil = json['response']['expire_date'], + trafficleft = float(json['response']['traffic_left']) / 1024, #@TODO: Remove `/ 1024` in 0.4.10 + premium = True else: self.logError(json['response_details']) + except Exception, e: self.logError(e) - return {"validuntil": None, "trafficleft": None, "premium": False} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft + 'premium' : premium, + 'sid' : sid} def login(self, user, data, req): @@ -50,7 +59,7 @@ class RapidgatorNet(Account): json = json_loads(json) if json['response_status'] == 200: - data['SID'] = str(json['response']['session_id']) + data['sid'] = str(json['response']['session_id']) return else: self.logError(json['response_details']) |