diff options
| author | 2013-07-20 18:14:08 +0200 | |
|---|---|---|
| committer | 2013-07-20 18:14:08 +0200 | |
| commit | abac8315248b6a72b0b4906548d9372f459cdd2e (patch) | |
| tree | 794a4aa946147e23ac43fde5db1098ff3e3db84c /module/plugins/accounts | |
| parent | Cleanup (diff) | |
| download | pyload-abac8315248b6a72b0b4906548d9372f459cdd2e.tar.xz | |
Code optimized
Diffstat (limited to 'module/plugins/accounts')
| -rw-r--r-- | module/plugins/accounts/SimplydebridCOM.py | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py index 53d707877..faa6091c5 100644 --- a/module/plugins/accounts/SimplydebridCOM.py +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -10,24 +10,24 @@ class SimplydebridCOM(Account):      __type__ = "account"      __description__ = """Simply-Debrid.com account plugin"""      __author_name__ = ("Kagenoshin") -    __author_mail__ = ("kagenoshin@gmx.ch")     +    __author_mail__ = ("kagenoshin@gmx.ch")      def loadAccountInfo(self, user, req): -        response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) +        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": -            account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} +            return {"premium": False}          else: -            account_info = { +            return {                  "trafficleft": -1, -                "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), -                "premium": True          +                "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y"))              } -        return account_info      def login(self, user, data, req):          self.loginname = user          self.password = data["password"] -        response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, decode = True, just_header = False)  +        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()
\ No newline at end of file +            self.wrongPassword() | 
