From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/RealdebridCom.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/RealdebridCom.py') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 5a31cc388..abab95a3d 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -14,11 +14,11 @@ from module.utils import parseFileSize class RealdebridCom(MultiHoster): __name__ = "RealdebridCom" __type__ = "hoster" - __version__ = "0.62" + __version__ = "0.63" __pattern__ = r'https?://((?:www\.|s\d+\.)?real-debrid\.com/dl/|[\w^_]\.rdb\.so/d/)[\w^_]+' - __description__ = """Real-Debrid.com hoster plugin""" + __description__ = """Real-Debrid.com multi-hoster plugin""" __license__ = "GPLv3" __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] @@ -37,10 +37,10 @@ class RealdebridCom(MultiHoster): self.chunkLimit = 3 - def handlePremium(self): + def handlePremium(self, pyfile): data = json_loads(self.load("https://real-debrid.com/ajax/unrestrict.php", get={'lang' : "en", - 'link' : self.pyfile.url, + 'link' : pyfile.url, 'password': self.getPassword(), 'time' : int(time() * 1000)})) @@ -53,9 +53,9 @@ class RealdebridCom(MultiHoster): self.logWarning(data['message']) self.tempOffline() else: - if self.pyfile.name is not None and self.pyfile.name.endswith('.tmp') and data['file_name']: - self.pyfile.name = data['file_name'] - self.pyfile.size = parseFileSize(data['file_size']) + if pyfile.name is not None and pyfile.name.endswith('.tmp') and data['file_name']: + pyfile.name = data['file_name'] + pyfile.size = parseFileSize(data['file_size']) self.link = data['generated_links'][0][-1] if self.getConfig("https"): @@ -63,23 +63,20 @@ class RealdebridCom(MultiHoster): else: self.link = self.link.replace("https://", "http://") - if self.link != self.pyfile.url: + if self.link != pyfile.url: self.logDebug("New URL: %s" % self.link) - if self.pyfile.name.startswith("http") or self.pyfile.name.startswith("Unknown") or self.pyfile.name.endswith('..'): + if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): #only use when name wasnt already set - self.pyfile.name = self.getFilename(self.link) + pyfile.name = self.getFilename(self.link) def checkFile(self): - super(RealdebridCom, self).checkFile() - - check = self.checkDownload( - {"error": "An error occured while processing your request"}) - - if check == "error": + if self.checkDownload({"error": "An error occured while processing your request"}): #usual this download can safely be retried self.retry(wait_time=60, reason=_("An error occured while generating link")) + return super(RealdebridCom, self).checkFile() + getInfo = create_getInfo(RealdebridCom) -- cgit v1.2.3 From f533c3c58f632e188d288535fc972e633c6b8f0a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 17:34:30 +0100 Subject: Fix SSL option in some hoster plugins --- module/plugins/hoster/RealdebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/RealdebridCom.py') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index abab95a3d..bf9fda293 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -14,7 +14,7 @@ from module.utils import parseFileSize class RealdebridCom(MultiHoster): __name__ = "RealdebridCom" __type__ = "hoster" - __version__ = "0.63" + __version__ = "0.64" __pattern__ = r'https?://((?:www\.|s\d+\.)?real-debrid\.com/dl/|[\w^_]\.rdb\.so/d/)[\w^_]+' @@ -58,7 +58,7 @@ class RealdebridCom(MultiHoster): pyfile.size = parseFileSize(data['file_size']) self.link = data['generated_links'][0][-1] - if self.getConfig("https"): + if self.getConfig("ssl"): self.link = self.link.replace("http://", "https://") else: self.link = self.link.replace("https://", "http://") -- cgit v1.2.3