summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/accounts/PremiumTo.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 13:35:34 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 13:35:34 +0200
commit1066d65b9ed19d8e1b061c13fc0156d823fea800 (patch)
tree4c1fcd3b0660d2ccb3ce4d2abc0077f1a7876725 /pyload/plugins/accounts/PremiumTo.py
parentDocs cleanup + remove script directory (diff)
parent[FTP] Restore pattern. (diff)
downloadpyload-1066d65b9ed19d8e1b061c13fc0156d823fea800.tar.xz
Merge remote-tracking branch 'pyload/stable' into 0.4.10
Conflicts: module/plugins/accounts/MultiDebridCom.py module/plugins/accounts/MyfastfileCom.py module/plugins/hooks/MultiDebridCom.py module/plugins/hooks/MyfastfileCom.py module/plugins/hooks/Premium4Me.py module/plugins/hooks/PremiumTo.py module/plugins/hoster/MultiDebridCom.py module/plugins/hoster/MyfastfileCom.py module/plugins/hoster/Premium4Me.py module/plugins/hoster/PremiumTo.py pyload/plugins/accounts/MultiDebridCom.py pyload/plugins/accounts/Premium4Me.py pyload/plugins/hooks/MultiDebridCom.py pyload/plugins/hooks/Premium4Me.py pyload/plugins/hoster/MultiDebridCom.py pyload/plugins/hoster/Premium4Me.py
Diffstat (limited to 'pyload/plugins/accounts/PremiumTo.py')
-rw-r--r--pyload/plugins/accounts/PremiumTo.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/pyload/plugins/accounts/PremiumTo.py b/pyload/plugins/accounts/PremiumTo.py
new file mode 100644
index 000000000..3b757bdf2
--- /dev/null
+++ b/pyload/plugins/accounts/PremiumTo.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+
+from pyload.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()