summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/accounts
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-08-13 23:11:27 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-08-13 23:11:27 +0200
commite20cde8ff0a53c0edb9db11ba2cc5d1510d086bb (patch)
tree873565556c04a273fd04ea15a0d7124fbc4a6637 /pyload/plugins/accounts
parentMerge pull request #226 from Kagenoshin/simplydebrid (diff)
downloadpyload-e20cde8ff0a53c0edb9db11ba2cc5d1510d086bb.tar.xz
Moved new plugins to pyload
Diffstat (limited to 'pyload/plugins/accounts')
-rw-r--r--pyload/plugins/accounts/SimplydebridCom.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/pyload/plugins/accounts/SimplydebridCom.py b/pyload/plugins/accounts/SimplydebridCom.py
new file mode 100644
index 000000000..82b499bbd
--- /dev/null
+++ b/pyload/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()