diff options
Diffstat (limited to 'module/plugins/hoster/UnrestrictLi.py')
-rw-r--r-- | module/plugins/hoster/UnrestrictLi.py | 16 |
1 files changed, 8 insertions, 8 deletions
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() |