summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/PremiumizeMe.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/PremiumizeMe.py')
-rw-r--r--module/plugins/hoster/PremiumizeMe.py32
1 files changed, 17 insertions, 15 deletions
diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py
index 3227fb001..d968eccec 100644
--- a/module/plugins/hoster/PremiumizeMe.py
+++ b/module/plugins/hoster/PremiumizeMe.py
@@ -7,38 +7,40 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class PremiumizeMe(MultiHoster):
__name__ = "PremiumizeMe"
__type__ = "hoster"
- __version__ = "0.16"
+ __version__ = "0.20"
+ __status__ = "testing"
- __pattern__ = r'^unmatchable$' #: Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady
- __config__ = [("use_premium", "bool", "Use premium account if available", True)]
+ __pattern__ = r'^unmatchable$' #: Since we want to allow the user to specify the list of hoster to use we let MultiHoster.activate
+ __config__ = [("use_premium" , "bool", "Use premium account if available" , True),
+ ("revertfailed", "bool", "Revert to standard download if fails", True)]
__description__ = """Premiumize.me multi-hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")]
- def handlePremium(self, pyfile):
- # In some cases hostsers do not supply us with a filename at download, so we
- # are going to set a fall back filename (e.g. for freakshare or xfileshare)
- pyfile.name = pyfile.name.split('/').pop() # Remove everthing before last slash
+ def handle_premium(self, pyfile):
+ #: In some cases hostsers do not supply us with a filename at download, so we
+ #: Are going to set a fall back filename (e.g. for freakshare or xfileshare)
+ pyfile.name = pyfile.name.split('/').pop() #: Remove everthing before last slash
- # Correction for automatic assigned filename: Removing html at end if needed
+ #: Correction for automatic assigned filename: Removing html at end if needed
suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"]
temp = pyfile.name.split('.')
if temp.pop() in suffix_to_remove:
pyfile.name = ".".join(temp)
- # Get account data
- user, data = self.account.selectAccount()
+ #: Get account data
+ user, info = self.account.select()
- # Get rewritten link using the premiumize.me api v1 (see https://secure.premiumize.me/?show=api)
- data = json_loads(self.load("https://api.premiumize.me/pm-api/v1.php",
+ #: Get rewritten link using the premiumize.me api v1 (see https://secure.premiumize.me/?show=api)
+ data = json_loads(self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10
get={'method' : "directdownloadlink",
'params[login]': user,
- 'params[pass]' : data['password'],
+ 'params[pass]' : info['login']['password'],
'params[link]' : pyfile.url}))
- # Check status and decide what to do
+ #: Check status and decide what to do
status = data['status']
if status == 200:
@@ -52,7 +54,7 @@ class PremiumizeMe(MultiHoster):
self.offline()
elif status >= 500:
- self.tempOffline()
+ self.temp_offline()
else:
self.fail(data['statusmessage'])