diff options
Diffstat (limited to 'module/plugins/hoster/AlldebridCom.py')
-rw-r--r-- | module/plugins/hoster/AlldebridCom.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 2ed09f58c..753712d5c 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -5,16 +5,18 @@ import urllib from module.common.json_layer import json_loads from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -from module.utils import parseFileSize +from module.utils import parseFileSize as parse_size class AlldebridCom(MultiHoster): __name__ = "AlldebridCom" __type__ = "hoster" - __version__ = "0.46" + __version__ = "0.48" + __status__ = "testing" __pattern__ = r'https?://(?:www\.|s\d+\.)?alldebrid\.com/dl/[\w^_]+' - __config__ = [("use_premium", "bool", "Use premium account if available", True)] + __config__ = [("use_premium" , "bool", "Use premium account if available" , True), + ("revertfailed", "bool", "Revert to standard download if fails", True)] __description__ = """Alldebrid.com multi-hoster plugin""" __license__ = "GPLv3" @@ -22,33 +24,28 @@ class AlldebridCom(MultiHoster): def setup(self): - self.chunkLimit = 16 + self.chunk_limit = 16 - def handlePremium(self, pyfile): - password = self.getPassword() + def handle_premium(self, pyfile): + password = self.get_password() data = json_loads(self.load("http://www.alldebrid.com/service.php", get={'link': pyfile.url, 'json': "true", 'pw': password})) - self.logDebug("Json data", data) + self.log_debug("Json data", data) if data['error']: if data['error'] == "This link isn't available on the hoster website.": self.offline() else: - self.logWarning(data['error']) - self.tempOffline() + self.log_warning(data['error']) + self.temp_offline() else: if pyfile.name and not pyfile.name.endswith('.tmp'): pyfile.name = data['filename'] - pyfile.size = parseFileSize(data['filesize']) + pyfile.size = parse_size(data['filesize']) self.link = data['link'] - if self.getConfig('ssl'): - self.link = self.link.replace("http://", "https://") - else: - self.link = self.link.replace("https://", "http://") - getInfo = create_getInfo(AlldebridCom) |