summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/LinksnappyCom.py
diff options
context:
space:
mode:
authorGravatar jansohn <jansohn@users.noreply.github.com> 2015-10-02 10:09:26 +0200
committerGravatar jansohn <jansohn@users.noreply.github.com> 2015-10-02 10:09:26 +0200
commit3a08656c5665f4b8db98744fb323e64b8630e084 (patch)
tree28f9f62ffc57888b76ca32540dbf5af3a4cfc8d0 /module/plugins/accounts/LinksnappyCom.py
parentMerge pull request #1 from pyload/stable (diff)
parent[Account] Improve parse_traffic method + code cosmetics (diff)
downloadpyload-3a08656c5665f4b8db98744fb323e64b8630e084.tar.xz
Merge pull request #2 from pyload/stable
sync with stable
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()