diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-08 00:29:57 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 11:02:23 +0200 |
commit | 68d662e689cd42687341c550fb6ebb74e6968d21 (patch) | |
tree | 486cef41bd928b8db704894233b2cef94a6e346f /module/plugins/accounts/LinksnappyCom.py | |
parent | save_join -> safe_join & save_path -> safe_filename (diff) | |
download | pyload-68d662e689cd42687341c550fb6ebb74e6968d21.tar.xz |
module -> pyload
Diffstat (limited to 'module/plugins/accounts/LinksnappyCom.py')
-rw-r--r-- | module/plugins/accounts/LinksnappyCom.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py deleted file mode 100644 index a03357e25..000000000 --- a/module/plugins/accounts/LinksnappyCom.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- - -from hashlib import md5 - -from module.plugins.Account import Account -from module.common.json_layer import json_loads - - -class LinksnappyCom(Account): - __name__ = "LinksnappyCom" - __type__ = "account" - __version__ = "0.02" - - __description__ = """Linksnappy.com account plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - - def loadAccountInfo(self, user, req): - 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) - - if 'trafficleft' not in j['return'] or isinstance(j['return']['trafficleft'], str): - trafficleft = -1 - else: - trafficleft = int(j['return']['trafficleft']) * 1024 - - return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} - - 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()}) - - if 'Invalid Account Details' in r: - self.wrongPassword() |