summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/LinksnappyCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/LinksnappyCom.py')
-rw-r--r--module/plugins/accounts/LinksnappyCom.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py
index 00ae64b44..6953f311c 100644
--- a/module/plugins/accounts/LinksnappyCom.py
+++ b/module/plugins/accounts/LinksnappyCom.py
@@ -9,16 +9,26 @@ from module.common.json_layer import json_loads
class LinksnappyCom(Account):
__name__ = "LinksnappyCom"
__type__ = "account"
- __version__ = "0.07"
+ __version__ = "0.10"
__status__ = "testing"
+ __config__ = [("mh_mode" , "all;listed;unlisted", "Filter hosters to use" , "all"),
+ ("mh_list" , "str" , "Hoster list (comma separated)", "" ),
+ ("mh_interval", "int" , "Reload interval in minutes" , 60 )]
+
__description__ = """Linksnappy.com account plugin"""
__license__ = "GPLv3"
__authors__ = [("stickell", "l.stickell@yahoo.it")]
- def parse_info(self, user, password, data, req):
- data = self.get_data(user)
+ def grab_hosters(self, user, password, data):
+ json_data = self.load("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"})
+ json_data = json_loads(json_data)
+
+ return json_data['return'].keys()
+
+
+ def grab_info(self, user, password, data):
r = self.load('http://gen.linksnappy.com/lseAPI.php',
get={'act' : 'USERDETAILS',
'username': user,
@@ -45,18 +55,18 @@ class LinksnappyCom(Account):
if 'trafficleft' not in j['return'] or isinstance(j['return']['trafficleft'], str):
trafficleft = -1
else:
- trafficleft = self.parse_traffic("%d MB" % j['return']['trafficleft'])
+ trafficleft = self.parse_traffic(j['return']['trafficleft'], "MB")
return {'premium' : True ,
'validuntil' : validuntil ,
'trafficleft': trafficleft}
- def login(self, user, password, data, req):
+ def signin(self, user, password, data):
html = self.load("https://gen.linksnappy.com/lseAPI.php",
get={'act' : 'USERDETAILS',
'username': user,
'password': hashlib.md5(password).hexdigest()})
if "Invalid Account Details" in html:
- self.login_fail()
+ self.fail_login()