diff options
author | lazlev <lazlev@yopmail.com> | 2015-08-09 00:50:54 +0200 |
---|---|---|
committer | lazlev <lazlev@yopmail.com> | 2015-08-09 00:50:54 +0200 |
commit | b0ef3f1673e1930916604bb1264ca3a38414bc8d (patch) | |
tree | c97936e4d2a4cd6eb1072c65c8a08a7d18816b18 /module/plugins/hoster/RealdebridCom.py | |
parent | [XFileSharingPro][XFileSharingProFolder] Added default __pattern__ (diff) | |
parent | Fix https://github.com/pyload/pyload/issues/1707 (diff) | |
download | pyload-b0ef3f1673e1930916604bb1264ca3a38414bc8d.tar.xz |
Merge pull request #1 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/hoster/RealdebridCom.py')
-rw-r--r-- | module/plugins/hoster/RealdebridCom.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 4500fcefc..6409701e4 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -6,16 +6,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 RealdebridCom(MultiHoster): __name__ = "RealdebridCom" __type__ = "hoster" - __version__ = "0.67" + __version__ = "0.69" + __status__ = "testing" __pattern__ = r'https?://((?:www\.|s\d+\.)?real-debrid\.com/dl/|[\w^_]\.rdb\.so/d/)[\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__ = """Real-Debrid.com multi-hoster plugin""" __license__ = "GPLv3" @@ -23,34 +25,29 @@ class RealdebridCom(MultiHoster): def setup(self): - self.chunkLimit = 3 + self.chunk_limit = 3 - def handlePremium(self, pyfile): + def handle_premium(self, pyfile): data = json_loads(self.load("https://real-debrid.com/ajax/unrestrict.php", get={'lang' : "en", 'link' : pyfile.url, - 'password': self.getPassword(), + 'password': self.get_password(), 'time' : int(time.time() * 1000)})) - self.logDebug("Returned Data: %s" % data) + self.log_debug("Returned Data: %s" % data) if data['error'] != 0: if data['message'] == "Your file is unavailable on the hoster.": self.offline() else: - self.logWarning(data['message']) - self.tempOffline() + self.log_warning(data['message']) + self.temp_offline() else: if pyfile.name and pyfile.name.endswith('.tmp') and data['file_name']: pyfile.name = data['file_name'] - pyfile.size = parseFileSize(data['file_size']) + pyfile.size = parse_size(data['file_size']) self.link = data['generated_links'][0][-1] - if self.getConfig('ssl'): - self.link = self.link.replace("http://", "https://") - else: - self.link = self.link.replace("https://", "http://") - getInfo = create_getInfo(RealdebridCom) |