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 | |
parent | Merge pull request #1087 from grapemix/stable (diff) | |
download | pyload-749adf8ccfec097b78d4926a48adbcc96ad267cd.tar.xz |
[RapidgatorNet] Fix account sid
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/accounts/RapidgatorNet.py | 23 | ||||
-rw-r--r-- | module/plugins/hoster/RapidgatorNet.py | 4 |
2 files changed, 18 insertions, 9 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']) diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 51d70de87..f7e6534f2 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -13,7 +13,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, s class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" - __version__ = "0.30" + __version__ = "0.31" __pattern__ = r'http://(?:www\.)?(rapidgator\.net|rg\.to)/file/\w+' @@ -46,7 +46,7 @@ class RapidgatorNet(SimpleHoster): def setup(self): if self.account: - self.sid = self.account.getAccountInfo(self.user).get('SID', None) + self.sid = self.account.getAccountInfo(self.user).get('sid', None) else: self.sid = None |