diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-08 23:31:33 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-08 23:31:33 +0100 |
commit | 36e60a23497ae05736c24fed2f4ce936fb61f744 (patch) | |
tree | d743ace8e6c032cccb524cbb8474263d9d7bd4e1 /module/plugins/accounts/LinksnappyCom.py | |
parent | "New Year" Update: internal plugins (diff) | |
download | pyload-36e60a23497ae05736c24fed2f4ce936fb61f744.tar.xz |
"New Year" Update: account plugins
Diffstat (limited to 'module/plugins/accounts/LinksnappyCom.py')
-rw-r--r-- | module/plugins/accounts/LinksnappyCom.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index 19986157b..dff28a055 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class LinksnappyCom(Account): __name__ = "LinksnappyCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Linksnappy.com account plugin""" __license__ = "GPLv3" @@ -20,17 +20,22 @@ class LinksnappyCom(Account): data = self.getAccountData(user) r = req.load('http://gen.linksnappy.com/lseAPI.php', get={'act': 'USERDETAILS', 'username': user, 'password': md5(data['password']).hexdigest()}) + self.logDebug("JSON data: " + r) + j = json_loads(r) if j['error']: return {"premium": False} validuntil = j['return']['expire'] + if validuntil == 'lifetime': validuntil = -1 + elif validuntil == 'expired': return {"premium": False} + else: validuntil = float(validuntil) @@ -43,8 +48,11 @@ class LinksnappyCom(Account): def login(self, user, data, req): - r = req.load('http://gen.linksnappy.com/lseAPI.php', - get={'act': 'USERDETAILS', 'username': user, 'password': md5(data['password']).hexdigest()}) + r = req.load("http://gen.linksnappy.com/lseAPI.php", + get={'act' : 'USERDETAILS', + 'username': user, + 'password': md5(data['password']).hexdigest()}, + decode=True) if 'Invalid Account Details' in r: self.wrongPassword() |