diff options
author | Stefano <l.stickell@yahoo.it> | 2013-10-13 17:42:02 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-10-13 17:42:02 +0200 |
commit | 98445d7446b202334ebacbac282ba04fe3267fd5 (patch) | |
tree | 2439813ed6275c7fcf0a1a3d745a0aa752bf48f4 | |
parent | Zippyshare: little improvements. (diff) | |
download | pyload-98445d7446b202334ebacbac282ba04fe3267fd5.tar.xz |
MultiHosters: no need an account if the link has already been converted.
See also #307
-rw-r--r-- | module/plugins/hoster/AlldebridCom.py | 21 | ||||
-rw-r--r-- | module/plugins/hoster/DebridItaliaCom.py | 16 | ||||
-rw-r--r-- | module/plugins/hoster/FastixRu.py | 16 | ||||
-rw-r--r-- | module/plugins/hoster/MultiDebridCom.py | 16 | ||||
-rw-r--r-- | module/plugins/hoster/RealdebridCom.py | 17 | ||||
-rw-r--r-- | module/plugins/hoster/UnrestrictLi.py | 16 |
6 files changed, 50 insertions, 52 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index cdb5ccc08..82f4531a6 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -10,7 +10,7 @@ from module.utils import parseFileSize class AlldebridCom(Hoster): __name__ = "AlldebridCom" - __version__ = "0.33" + __version__ = "0.34" __type__ = "hoster" __pattern__ = r"https?://.*alldebrid\..*" @@ -23,24 +23,22 @@ class AlldebridCom(Hoster): name = unquote(url.rsplit("/", 1)[1]) except IndexError: name = "Unknown_Filename..." - if name.endswith("..."): #incomplete filename, append random stuff + if name.endswith("..."): # incomplete filename, append random stuff name += "%s.tmp" % randrange(100, 999) return name - def init(self): - self.tries = 0 - self.chunkLimit = 3 + def setup(self): + self.chunkLimit = 16 self.resumeDownload = True def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid") - self.fail("No AllDebrid account provided") - - self.logDebug("AllDebrid: Old URL: %s" % pyfile.url) if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url + elif not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid") + self.fail("No AllDebrid account provided") else: + self.logDebug("Old URL: %s" % pyfile.url) password = self.getPassword().splitlines() password = "" if not password else password[0] @@ -67,7 +65,8 @@ class AlldebridCom(Hoster): else: new_url = new_url.replace("https://", "http://") - self.logDebug("AllDebrid: New URL: %s" % new_url) + if new_url != pyfile.url: + self.logDebug("New URL: %s" % new_url) if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): #only use when name wasnt already set diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index 1c2f4246b..08470b984 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -22,26 +22,25 @@ from module.plugins.Hoster import Hoster class DebridItaliaCom(Hoster): __name__ = "DebridItaliaCom" - __version__ = "0.04" + __version__ = "0.05" __type__ = "hoster" __pattern__ = r"https?://.*debriditalia\.com" __description__ = """Debriditalia.com hoster plugin""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") - def init(self): + def setup(self): self.chunkLimit = -1 self.resumeDownload = True def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia") - self.fail("No DebridItalia account provided") - - self.logDebug("Old URL: %s" % pyfile.url) if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url + elif not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia") + self.fail("No DebridItalia account provided") else: + self.logDebug("Old URL: %s" % pyfile.url) url = "http://debriditalia.com/linkgen2.php?xjxfun=convertiLink&xjxargs[]=S<![CDATA[%s]]>" % pyfile.url page = self.load(url) self.logDebug("XML data: %s" % page) @@ -51,7 +50,8 @@ class DebridItaliaCom(Hoster): else: new_url = re.search(r'<a href="(?:[^"]+)">(?P<direct>[^<]+)</a>', page).group('direct') - self.logDebug("New URL: %s" % new_url) + if new_url != pyfile.url: + self.logDebug("New URL: %s" % new_url) self.download(new_url, disposition=True) diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 4d3e7b93d..c2791c5d2 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class FastixRu(Hoster): __name__ = "FastixRu" - __version__ = "0.02" + __version__ = "0.03" __type__ = "hoster" __pattern__ = r"http?://.*fastix.ru\..*" __description__ = """Fastix hoster plugin""" @@ -25,19 +25,18 @@ class FastixRu(Hoster): name += "%s.tmp" % randrange(100, 999) return name - def init(self): + def setup(self): self.chunkLimit = 3 self.resumeDownload = True def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Fastix") - self.fail("No Fastix account provided") - - self.logDebug("Old URL: %s" % pyfile.url) if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url + elif not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "Fastix") + self.fail("No Fastix account provided") else: + self.logDebug("Old URL: %s" % pyfile.url) api_key = self.account.getAccountData(self.user) api_key = api_key["api"] url = "http://fastix.ru/api_v2/?apikey=%s&sub=getdirectlink&link=%s" % (api_key, pyfile.url) @@ -49,7 +48,8 @@ class FastixRu(Hoster): else: new_url = data["downloadlink"] - self.logDebug("New URL: %s" % new_url) + if new_url != pyfile.url: + self.logDebug("New URL: %s" % new_url) if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): #only use when name wasnt already set diff --git a/module/plugins/hoster/MultiDebridCom.py b/module/plugins/hoster/MultiDebridCom.py index 7280504cb..83f477f34 100644 --- a/module/plugins/hoster/MultiDebridCom.py +++ b/module/plugins/hoster/MultiDebridCom.py @@ -23,26 +23,25 @@ from module.common.json_layer import json_loads class MultiDebridCom(Hoster): __name__ = "MultiDebridCom" - __version__ = "0.02" + __version__ = "0.03" __type__ = "hoster" __pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/" __description__ = """Multi-debrid.com hoster plugin""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") - def init(self): + def setup(self): self.chunkLimit = -1 self.resumeDownload = True def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Multi-debrid.com") - self.fail("No Multi-debrid.com account provided") - - self.logDebug("Original URL: %s" % pyfile.url) if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url + elif not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "Multi-debrid.com") + self.fail("No Multi-debrid.com account provided") else: + self.logDebug("Original URL: %s" % pyfile.url) page = self.req.load('http://multi-debrid.com/api.php', get={'user': self.user, 'pass': self.account.getAccountData(self.user)['password'], 'link': pyfile.url}) @@ -52,6 +51,7 @@ class MultiDebridCom(Hoster): self.fail('Unable to unrestrict link') new_url = page['link'] - self.logDebug("Unrestricted URL: " + new_url) + if new_url != pyfile.url: + self.logDebug("Unrestricted URL: " + new_url) self.download(new_url, disposition=True) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index fd91b89b7..59997ee7c 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster class RealdebridCom(Hoster): __name__ = "RealdebridCom" - __version__ = "0.51" + __version__ = "0.52" __type__ = "hoster" __pattern__ = r"https?://.*real-debrid\..*" @@ -30,20 +30,18 @@ class RealdebridCom(Hoster): name += "%s.tmp" % randrange(100, 999) return name - def init(self): - self.tries = 0 + def setup(self): self.chunkLimit = 3 self.resumeDownload = True def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") - self.fail("No Real-debrid account provided") - - self.logDebug("Real-Debrid: Old URL: %s" % pyfile.url) if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url + elif not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") + self.fail("No Real-debrid account provided") else: + self.logDebug("Old URL: %s" % pyfile.url) password = self.getPassword().splitlines() if not password: password = "" @@ -74,7 +72,8 @@ class RealdebridCom(Hoster): else: new_url = new_url.replace("https://", "http://") - self.logDebug("Real-Debrid: New URL: %s" % new_url) + if new_url != pyfile.url: + self.logDebug("New URL: %s" % new_url) if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): #only use when name wasnt already set diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index bdafca63d..a3fe5ff5d 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -35,26 +35,25 @@ def secondsToMidnight(): class UnrestrictLi(Hoster): __name__ = "UnrestrictLi" - __version__ = "0.10" + __version__ = "0.11" __type__ = "hoster" __pattern__ = r"https?://.*(unrestrict|unr)\.li" __description__ = """Unrestrict.li hoster plugin""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") - def init(self): + def setup(self): self.chunkLimit = 16 self.resumeDownload = True def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Unrestrict.li") - self.fail("No Unrestrict.li account provided") - - self.logDebug("Old URL: %s" % pyfile.url) if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url + elif not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "Unrestrict.li") + self.fail("No Unrestrict.li account provided") else: + self.logDebug("Old URL: %s" % pyfile.url) for i in xrange(5): page = self.req.load('https://unrestrict.li/unrestrict.php', post={'link': pyfile.url, 'domain': 'long'}) @@ -83,7 +82,8 @@ class UnrestrictLi(Hoster): new_url = page.keys()[0] self.api_data = page[new_url] - self.logDebug("New URL: " + new_url) + if new_url != pyfile.url: + self.logDebug("New URL: " + new_url) if hasattr(self, 'api_data'): self.setNameSize() |