summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/PremiumTo.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/PremiumTo.py')
-rw-r--r--module/plugins/accounts/PremiumTo.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py
index c8ea2fa26..ba8f24c6d 100644
--- a/module/plugins/accounts/PremiumTo.py
+++ b/module/plugins/accounts/PremiumTo.py
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
-from module.plugins.Account import Account
+from module.plugins.internal.Account import Account
class PremiumTo(Account):
__name__ = "PremiumTo"
__type__ = "account"
- __version__ = "0.08"
+ __version__ = "0.11"
+ __status__ = "testing"
__description__ = """Premium.to account plugin"""
__license__ = "GPLv3"
@@ -15,9 +16,10 @@ class PremiumTo(Account):
("stickell", "l.stickell@yahoo.it")]
- def loadAccountInfo(self, user, req):
- traffic = req.load("http://premium.to/api/straffic.php",
- get={'username': self.username, 'password': self.password})
+ def parse_info(self, user, password, data, req):
+ traffic = self.load("http://premium.to/api/straffic.php", #@TODO: Revert to `https` in 0.4.10
+ get={'username': self.username,
+ 'password': self.password})
if "wrong username" not in traffic:
trafficleft = sum(map(float, traffic.split(';'))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
@@ -26,12 +28,12 @@ class PremiumTo(Account):
return {'premium': False, 'trafficleft': None, 'validuntil': None}
- def login(self, user, data, req):
+ def login(self, user, password, data, req):
self.username = user
- self.password = data['password']
- authcode = req.load("http://premium.to/api/getauthcode.php",
- get={'username': user, 'password': self.password},
- decode=True)
+ self.password = password
+ authcode = self.load("http://premium.to/api/getauthcode.php", #@TODO: Revert to `https` in 0.4.10
+ get={'username': user,
+ 'password': self.password})
if "wrong username" in authcode:
- self.wrongPassword()
+ self.login_fail()