From 8e7d14bae4d3c836f029a1235eb227380acc3f75 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 16 Feb 2015 21:59:10 +0100 Subject: Fix plugins to work on 0.4.10 --- module/plugins/accounts/LinksnappyCom.py | 57 -------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 module/plugins/accounts/LinksnappyCom.py (limited to 'module/plugins/accounts/LinksnappyCom.py') diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py deleted file mode 100644 index 0b1176ee9..000000000 --- a/module/plugins/accounts/LinksnappyCom.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- - -from hashlib import md5 - -from pyload.plugin.Account import Account -from pyload.utils import json_loads - - -class LinksnappyCom(Account): - __name__ = "LinksnappyCom" - __type__ = "account" - __version__ = "0.05" - __description__ = """Linksnappy.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "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 = self.parseTraffic("%d MB" % j['return']['trafficleft']) - - 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()}, - decode=True) - - if 'Invalid Account Details' in r: - self.wrongPassword() -- cgit v1.2.3