summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
authorGravatar stickell <l.stickell@yahoo.it> 2014-09-12 17:54:39 +0200
committerGravatar stickell <l.stickell@yahoo.it> 2014-09-12 17:54:39 +0200
commita64c0d41a27da58dc004f97bc934c8b3018a1de9 (patch)
tree731cb187d4c3ee63f39caab130636208346abebd /module/plugins/accounts
parent[MultiDebrid] renaming files to MyfastlineCom (diff)
downloadpyload-a64c0d41a27da58dc004f97bc934c8b3018a1de9.tar.xz
[Premium4Me] Renamed to PremiumTo
+ partial rewrite + special traffic support
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/Premium4Me.py29
-rw-r--r--module/plugins/accounts/PremiumTo.py28
2 files changed, 28 insertions, 29 deletions
diff --git a/module/plugins/accounts/Premium4Me.py b/module/plugins/accounts/Premium4Me.py
deleted file mode 100644
index 9f66af414..000000000
--- a/module/plugins/accounts/Premium4Me.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.plugins.Account import Account
-
-
-class Premium4Me(Account):
- __name__ = "Premium4Me"
- __type__ = "account"
- __version__ = "0.03"
-
- __description__ = """Premium.to account plugin"""
- __author_name__ = ("RaNaN", "zoidberg", "stickell")
- __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it")
-
-
- def loadAccountInfo(self, user, req):
- traffic = req.load("http://premium.to/api/traffic.php?authcode=%s" % self.authcode)
-
- account_info = {"trafficleft": int(traffic) / 1024,
- "validuntil": -1}
-
- return account_info
-
- def login(self, user, data, req):
- self.authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (
- user, data['password'])).strip()
-
- if "wrong username" in self.authcode:
- self.wrongPassword()
diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py
new file mode 100644
index 000000000..5678f8210
--- /dev/null
+++ b/module/plugins/accounts/PremiumTo.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.Account import Account
+
+
+class PremiumTo(Account):
+ __name__ = "PremiumTo"
+ __type__ = "account"
+ __version__ = "0.04"
+ __description__ = """Premium.to account plugin"""
+ __author_name__ = ("RaNaN", "zoidberg", "stickell")
+ __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+
+ def loadAccountInfo(self, user, req):
+ api_r = req.load("http://premium.to/api/straffic.php",
+ get={'username': self.username, 'password': self.password})
+ traffic = sum(map(int, api_r.split(';')))
+
+ return {"trafficleft": int(traffic) / 1024, "validuntil": -1}
+
+ def login(self, user, data, req):
+ self.username = user
+ self.password = data['password']
+ authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (
+ user, self.password)).strip()
+
+ if "wrong username" in authcode:
+ self.wrongPassword()