summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/PremiumizeMe.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-29 20:05:07 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-29 20:05:07 +0200
commitec6e5dc7fcdcefee10e37d22473c9accae1104cf (patch)
treed19824c0223b083d5b4256530443165cfabb7a04 /module/plugins/accounts/PremiumizeMe.py
parentMerge pull request #1850 from chaosblog/patch-2 (diff)
downloadpyload-ec6e5dc7fcdcefee10e37d22473c9accae1104cf.tar.xz
Account class completely rewritten + plugins updated
Diffstat (limited to 'module/plugins/accounts/PremiumizeMe.py')
-rw-r--r--module/plugins/accounts/PremiumizeMe.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py
index fcc187efd..8fa2030c1 100644
--- a/module/plugins/accounts/PremiumizeMe.py
+++ b/module/plugins/accounts/PremiumizeMe.py
@@ -7,7 +7,7 @@ from module.plugins.internal.Account import Account
class PremiumizeMe(Account):
__name__ = "PremiumizeMe"
__type__ = "account"
- __version__ = "0.20"
+ __version__ = "0.21"
__status__ = "testing"
__description__ = """Premiumize.me account plugin"""
@@ -15,7 +15,24 @@ class PremiumizeMe(Account):
__authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")]
- def grab_info(self, user, password, data, req):
+ def grab_hosters(self, user, password, data):
+ #: Get supported hosters list from premiumize.me using the
+ #: json API v1 (see https://secure.premiumize.me/?show=api)
+ answer = self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10
+ get={'method' : "hosterlist",
+ 'params[login]': user,
+ 'params[pass]' : password})
+ data = json_loads(answer)
+
+ #: If account is not valid thera are no hosters available
+ if data['status'] != 200:
+ return []
+
+ #: Extract hosters from json file
+ return data['result']['hosterlist']
+
+
+ def grab_info(self, user, password, data):
#: Get user data from premiumize.me
status = self.get_account_status(user, password)
self.log_debug(status)
@@ -30,7 +47,7 @@ class PremiumizeMe(Account):
return account_info
- def login(self, user, password, data, req):
+ def signin(self, user, password, data):
#: Get user data from premiumize.me
status = self.get_account_status(user, password)