summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/SimplydebridCom.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-20 20:43:35 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-20 20:43:35 +0200
commit4d6f805c40f48cda9c57bc2e4a8f09bc37e046ec (patch)
treee12afd8bda3ce4ebab1731e32e0df3d428a4fba1 /module/plugins/accounts/SimplydebridCom.py
parentSimplydebrid: fixed syntax error (diff)
downloadpyload-4d6f805c40f48cda9c57bc2e4a8f09bc37e046ec.tar.xz
Simplydebrid: renamed to standard
Diffstat (limited to 'module/plugins/accounts/SimplydebridCom.py')
-rw-r--r--module/plugins/accounts/SimplydebridCom.py30
1 files changed, 30 insertions, 0 deletions
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()