From 4d6f805c40f48cda9c57bc2e4a8f09bc37e046ec Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 20 Jul 2013 20:43:35 +0200 Subject: Simplydebrid: renamed to standard --- module/plugins/accounts/SimplydebridCOM.py | 30 ------------------------------ module/plugins/accounts/SimplydebridCom.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 module/plugins/accounts/SimplydebridCOM.py create mode 100644 module/plugins/accounts/SimplydebridCom.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py deleted file mode 100644 index 2b14a37c2..000000000 --- a/module/plugins/accounts/SimplydebridCOM.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from time import mktime, strptime - -from module.plugins.Account import Account - - -class SimplydebridCOM(Account): - __name__ = "SimplydebridCOM" - __version__ = "0.1" - __type__ = "account" - __description__ = """Simply-Debrid.com account plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def loadAccountInfo(self, user, req): - get_data = {'login': 2, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) - data = [x.strip() for x in response.split(";")] - if str(data[0]) != "1": - return {"premium": False} - else: - return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} - - def login(self, user, data, req): - self.loginname = user - self.password = data["password"] - get_data = {'login': 1, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) - if response != "02: loggin success": - self.wrongPassword() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py new file mode 100644 index 000000000..82b499bbd --- /dev/null +++ b/module/plugins/accounts/SimplydebridCom.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from time import mktime, strptime + +from module.plugins.Account import Account + + +class SimplydebridCom(Account): + __name__ = "SimplydebridCom" + __version__ = "0.1" + __type__ = "account" + __description__ = """Simply-Debrid.com account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def loadAccountInfo(self, user, req): + get_data = {'login': 2, 'u': self.loginname, 'p': self.password} + response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + data = [x.strip() for x in response.split(";")] + if str(data[0]) != "1": + return {"premium": False} + else: + return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + get_data = {'login': 1, 'u': self.loginname, 'p': self.password} + response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + if response != "02: loggin success": + self.wrongPassword() -- cgit v1.2.3