diff options
author | 2015-09-29 20:05:07 +0200 | |
---|---|---|
committer | 2015-09-29 20:05:07 +0200 | |
commit | ec6e5dc7fcdcefee10e37d22473c9accae1104cf (patch) | |
tree | d19824c0223b083d5b4256530443165cfabb7a04 /module/plugins/accounts/PremiumTo.py | |
parent | Merge pull request #1850 from chaosblog/patch-2 (diff) | |
download | pyload-ec6e5dc7fcdcefee10e37d22473c9accae1104cf.tar.xz |
Account class completely rewritten + plugins updated
Diffstat (limited to 'module/plugins/accounts/PremiumTo.py')
-rw-r--r-- | module/plugins/accounts/PremiumTo.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index 946ee4f80..2b24f6edf 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account class PremiumTo(Account): __name__ = "PremiumTo" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __description__ = """Premium.to account plugin""" @@ -16,10 +16,17 @@ class PremiumTo(Account): ("stickell", "l.stickell@yahoo.it")] - def grab_info(self, user, password, data, req): + def grab_hosters(self, user, password, data): + html = self.load("http://premium.to/api/hosters.php", + get={'username': user, + 'password': password}) + return [x.strip() for x in html.replace("\"", "").split(";")] + + + def grab_info(self, user, password, data): traffic = self.load("http://premium.to/api/straffic.php", #@TODO: Revert to `https` in 0.4.10 - get={'username': self.username, - 'password': self.password}) + get={'username': user, + 'password': password}) if "wrong username" not in traffic: trafficleft = sum(map(float, traffic.split(';'))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 @@ -28,12 +35,10 @@ class PremiumTo(Account): return {'premium': False, 'trafficleft': None, 'validuntil': None} - def login(self, user, password, data, req): - self.username = user - self.password = password + def signin(self, user, password, data): authcode = self.load("http://premium.to/api/getauthcode.php", #@TODO: Revert to `https` in 0.4.10 get={'username': user, - 'password': self.password}) + 'password': password}) if "wrong username" in authcode: self.fail_login() |