diff options
Diffstat (limited to 'module/plugins/accounts/MyfastfileCom.py')
-rw-r--r-- | module/plugins/accounts/MyfastfileCom.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 008b62cc6..eff112a2f 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -9,15 +9,26 @@ from module.plugins.internal.Account import Account class MyfastfileCom(Account): __name__ = "MyfastfileCom" __type__ = "account" - __version__ = "0.06" + __version__ = "0.08" __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__ = """Myfastfile.com account plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] - def parse_info(self, user, password, data, req): + def grab_hosters(self, user, password, data): + json_data = self.load("http://myfastfile.com/api.php", get={'hosts': ""}) + self.log_debug("JSON data", json_data) + json_data = json_loads(json_data) + + return json_data['hosts'] + + def grab_info(self, user, password, data): if 'days_left' in self.json_data: validuntil = time.time() + self.json_data['days_left'] * 24 * 60 * 60 return {'premium': True, 'validuntil': validuntil, 'trafficleft': -1} @@ -25,7 +36,7 @@ class MyfastfileCom(Account): self.log_error(_("Unable to get account information")) - def login(self, user, password, data, req): + def signin(self, user, password, data): #: Password to use is the API-Password written in http://myfastfile.com/myaccount html = self.load("https://myfastfile.com/api.php", get={'user': user, @@ -35,5 +46,4 @@ class MyfastfileCom(Account): self.json_data = json_loads(html) if self.json_data['status'] != 'ok': - self.log_error(_('Invalid login. The password to use is the API-Password you find in your "My Account" page')) - self.login_fail() + self.fail_login(_("Invalid username or password")) |