From 0072668fd976f9ce4dbaac7e807791f21cbe07ed Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 6 Jul 2014 18:57:55 +0200 Subject: Compute wait time using secondsToMidnight --- module/plugins/hoster/UnrestrictLi.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index a0447d873..7558dfcf6 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -21,9 +21,8 @@ from module.plugins.Hoster import Hoster from module.common.json_layer import json_loads -def secondsToMidnight(): - # Seconds until 00:10 GMT+2 - now = datetime.utcnow() + timedelta(hours=2) +def secondsToMidnight(gmt=0): + now = datetime.utcnow() + timedelta(hours=gmt) if now.hour is 0 and now.minute < 10: midnight = now else: @@ -34,7 +33,7 @@ def secondsToMidnight(): class UnrestrictLi(Hoster): __name__ = "UnrestrictLi" - __version__ = "0.11" + __version__ = "0.12" __type__ = "hoster" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' __description__ = """Unrestrict.li hoster plugin""" @@ -72,8 +71,8 @@ class UnrestrictLi(Hoster): elif "You are not allowed to download from this host" in page: self.fail("You are not allowed to download from this host") elif "You have reached your daily limit for this host" in page: - self.logInfo("Reached daily limit for this host. Waiting until 00:10 GMT+2") - self.retry(5, secondsToMidnight(), "Daily limit for this host reached") + self.logWarning("Reached daily limit for this host") + self.retry(5, secondsToMidnight(gmt=2), "Daily limit for this host reached") elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in page: self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry") self.retry(5, 60, "Hoster is temporarily unavailable") -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/UnrestrictLi.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 7558dfcf6..ed70e023d 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -1,24 +1,11 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ import re + from datetime import datetime, timedelta -from module.plugins.Hoster import Hoster from module.common.json_layer import json_loads +from module.plugins.Hoster import Hoster def secondsToMidnight(gmt=0): @@ -33,13 +20,16 @@ def secondsToMidnight(gmt=0): class UnrestrictLi(Hoster): __name__ = "UnrestrictLi" - __version__ = "0.12" __type__ = "hoster" + __version__ = "0.12" + __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' + __description__ = """Unrestrict.li hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def setup(self): self.chunkLimit = 16 self.resumeDownload = True -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/UnrestrictLi.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index ed70e023d..56805c8c2 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -26,8 +26,7 @@ class UnrestrictLi(Hoster): __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' __description__ = """Unrestrict.li hoster plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def setup(self): -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/UnrestrictLi.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 56805c8c2..0cd8e315f 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -26,6 +26,7 @@ class UnrestrictLi(Hoster): __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' __description__ = """Unrestrict.li hoster plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From bb68489d85d3aae3d050a8d198f6615aed379690 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 15:19:37 +0200 Subject: Change some self.req.load to self.load --- module/plugins/hoster/UnrestrictLi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 0cd8e315f..2acb7816d 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -43,8 +43,8 @@ class UnrestrictLi(Hoster): else: self.logDebug("Old URL: %s" % pyfile.url) for _ in xrange(5): - page = self.req.load('https://unrestrict.li/unrestrict.php', - post={'link': pyfile.url, 'domain': 'long'}) + page = self.load('https://unrestrict.li/unrestrict.php', + post={'link': pyfile.url, 'domain': 'long'}) self.logDebug("JSON data: " + page) if page != '': break -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/UnrestrictLi.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 2acb7816d..a2ee2a020 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -34,6 +34,7 @@ class UnrestrictLi(Hoster): self.chunkLimit = 16 self.resumeDownload = True + def process(self, pyfile): if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url @@ -82,6 +83,7 @@ class UnrestrictLi(Hoster): self.load("https://unrestrict.li/history/&delete=all") self.logInfo("Download history deleted") + def setNameSize(self): if 'name' in self.api_data: self.pyfile.name = self.api_data['name'] -- cgit v1.2.3 From 1c4bf83881d2a22da3773666a580d51f6b57bfd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 03:07:21 +0200 Subject: Avoid gettext conflict due variable `_` --- module/plugins/hoster/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index a2ee2a020..fd53e0125 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -43,7 +43,7 @@ class UnrestrictLi(Hoster): self.fail("No Unrestrict.li account provided") else: self.logDebug("Old URL: %s" % pyfile.url) - for _ in xrange(5): + for _i in xrange(5): page = self.load('https://unrestrict.li/unrestrict.php', post={'link': pyfile.url, 'domain': 'long'}) self.logDebug("JSON data: " + page) -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/UnrestrictLi.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index fd53e0125..2de52075c 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -40,7 +40,7 @@ class UnrestrictLi(Hoster): 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") + self.fail(_("No Unrestrict.li account provided")) else: self.logDebug("Old URL: %s" % pyfile.url) for _i in xrange(5): @@ -50,7 +50,7 @@ class UnrestrictLi(Hoster): if page != '': break else: - self.logInfo("Unable to get API data, waiting 1 minute and retry") + self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) self.retry(5, 60, "Unable to get API data") if 'Expired session' in page or ("You are not allowed to " @@ -60,12 +60,12 @@ class UnrestrictLi(Hoster): elif "File offline" in page: self.offline() elif "You are not allowed to download from this host" in page: - self.fail("You are not allowed to download from this host") + self.fail(_("You are not allowed to download from this host")) elif "You have reached your daily limit for this host" in page: - self.logWarning("Reached daily limit for this host") + self.logWarning(_("Reached daily limit for this host")) self.retry(5, secondsToMidnight(gmt=2), "Daily limit for this host reached") elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in page: - self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry") + self.logInfo(_("Hoster temporarily unavailable, waiting 1 minute and retry")) self.retry(5, 60, "Hoster is temporarily unavailable") page = json_loads(page) new_url = page.keys()[0] @@ -81,7 +81,7 @@ class UnrestrictLi(Hoster): if self.getConfig("history"): self.load("https://unrestrict.li/history/&delete=all") - self.logInfo("Download history deleted") + self.logInfo(_("Download history deleted")) def setNameSize(self): -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/UnrestrictLi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 2de52075c..adfa2eb1f 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -19,15 +19,15 @@ def secondsToMidnight(gmt=0): class UnrestrictLi(Hoster): - __name__ = "UnrestrictLi" - __type__ = "hoster" + __name__ = "UnrestrictLi" + __type__ = "hoster" __version__ = "0.12" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' __description__ = """Unrestrict.li hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def setup(self): -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/hoster/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index adfa2eb1f..94ce1b845 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -80,7 +80,7 @@ class UnrestrictLi(Hoster): self.download(new_url, disposition=True) if self.getConfig("history"): - self.load("https://unrestrict.li/history/&delete=all") + self.load("https://unrestrict.li/history/", get={'delete': "all"}) self.logInfo(_("Download history deleted")) -- cgit v1.2.3 From f2da6bca43b619121df3f76fd27c98fa662c49db Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Dec 2014 14:54:12 +0100 Subject: [UnrestrictLi] Fix secondsToMidnight on python 2.5 & 2.6 --- module/plugins/hoster/UnrestrictLi.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 94ce1b845..615409dab 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -10,18 +10,26 @@ from module.plugins.Hoster import Hoster def secondsToMidnight(gmt=0): now = datetime.utcnow() + timedelta(hours=gmt) + if now.hour is 0 and now.minute < 10: midnight = now else: midnight = now + timedelta(days=1) - midnight = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - return int((midnight - now).total_seconds()) + + dt = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now + + if hasattr(dt, 'total_seconds'): + res = dt.total_seconds() + else: + res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 + + return int(res) class UnrestrictLi(Hoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' -- cgit v1.2.3 From d4b3941f2a494eb42a7d80ef825a57ad083ce29e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Dec 2014 14:57:35 +0100 Subject: [UnrestrictLi] Fix secondsToMidnight on python 2.5 & 2.6 (2) --- module/plugins/hoster/UnrestrictLi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 615409dab..d5c3ddc15 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -16,10 +16,10 @@ def secondsToMidnight(gmt=0): else: midnight = now + timedelta(days=1) - dt = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now + td = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now - if hasattr(dt, 'total_seconds'): - res = dt.total_seconds() + if hasattr(td, 'total_seconds'): + res = td.total_seconds() else: res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 @@ -29,7 +29,7 @@ def secondsToMidnight(gmt=0): class UnrestrictLi(Hoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' -- cgit v1.2.3 From 8bb189cf5495b293cf574e5049c34a64ae36ffe1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Dec 2014 23:04:15 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index d5c3ddc15..786e25a9a 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -20,7 +20,7 @@ def secondsToMidnight(gmt=0): if hasattr(td, 'total_seconds'): res = td.total_seconds() - else: + else: #@NOTE: work-around for python 2.5 and 2.6 missing timedelta.total_seconds res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 return int(res) -- cgit v1.2.3 From 57300575fa97107d172e0c9909b244c8c8ae6c12 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 20:02:20 +0100 Subject: Extend SimpleHoster in multi-hoster plugins --- module/plugins/hoster/UnrestrictLi.py | 85 ++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 41 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 786e25a9a..d0a03d7ec 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -5,7 +5,7 @@ import re from datetime import datetime, timedelta from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo def secondsToMidnight(gmt=0): @@ -26,7 +26,7 @@ def secondsToMidnight(gmt=0): return int(res) -class UnrestrictLi(Hoster): +class UnrestrictLi(SimpleHoster): __name__ = "UnrestrictLi" __type__ = "hoster" __version__ = "0.14" @@ -39,53 +39,53 @@ class UnrestrictLi(Hoster): def setup(self): - self.chunkLimit = 16 + self.chunkLimit = 16 self.resumeDownload = True - def process(self, pyfile): - 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")) + def handleMulti(self): + for _i in xrange(5): + page = self.load('https://unrestrict.li/unrestrict.php', + post={'link': self.pyfile.url, 'domain': 'long'}) + self.logDebug("JSON data: " + page) + if page != '': + break else: - self.logDebug("Old URL: %s" % pyfile.url) - for _i in xrange(5): - page = self.load('https://unrestrict.li/unrestrict.php', - post={'link': pyfile.url, 'domain': 'long'}) - self.logDebug("JSON data: " + page) - if page != '': - break - else: - self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) - self.retry(5, 60, "Unable to get API data") - - if 'Expired session' in page or ("You are not allowed to " - "download from this host" in page and self.premium): - self.account.relogin(self.user) - self.retry() - elif "File offline" in page: - self.offline() - elif "You are not allowed to download from this host" in page: - self.fail(_("You are not allowed to download from this host")) - elif "You have reached your daily limit for this host" in page: - self.logWarning(_("Reached daily limit for this host")) - self.retry(5, secondsToMidnight(gmt=2), "Daily limit for this host reached") - elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in page: - self.logInfo(_("Hoster temporarily unavailable, waiting 1 minute and retry")) - self.retry(5, 60, "Hoster is temporarily unavailable") - page = json_loads(page) - new_url = page.keys()[0] - self.api_data = page[new_url] - - if new_url != pyfile.url: - self.logDebug("New URL: " + new_url) + self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) + self.retry(5, 60, "Unable to get API data") + + if 'Expired session' in page or ("You are not allowed to " + "download from this host" in page and self.premium): + self.account.relogin(self.user) + self.retry() + + elif "File offline" in page: + self.offline() + + elif "You are not allowed to download from this host" in page: + self.fail(_("You are not allowed to download from this host")) + + elif "You have reached your daily limit for this host" in page: + self.logWarning(_("Reached daily limit for this host")) + self.retry(5, secondsToMidnight(gmt=2), "Daily limit for this host reached") + + elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in page: + self.logInfo(_("Hoster temporarily unavailable, waiting 1 minute and retry")) + self.retry(5, 60, "Hoster is temporarily unavailable") + + page = json_loads(page) + self.link = page.keys()[0] + self.api_data = page[self.link] + + if self.link != self.pyfile.url: + self.logDebug("New URL: " + self.link) if hasattr(self, 'api_data'): self.setNameSize() - self.download(new_url, disposition=True) + + def checkFile(self): + super(UnrestrictLi, self).checkFile() if self.getConfig("history"): self.load("https://unrestrict.li/history/", get={'delete': "all"}) @@ -97,3 +97,6 @@ class UnrestrictLi(Hoster): self.pyfile.name = self.api_data['name'] if 'size' in self.api_data: self.pyfile.size = self.api_data['size'] + + +getInfo = create_getInfo(UnrestrictLi) -- cgit v1.2.3 From 46f748a94ea5ab62ab0839ff0ce01e12e3eac688 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 21:47:39 +0100 Subject: Extend SimpleHoster in multi-hoster plugins (2) --- module/plugins/hoster/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index d0a03d7ec..fcdbbd284 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -29,7 +29,7 @@ def secondsToMidnight(gmt=0): class UnrestrictLi(SimpleHoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' -- cgit v1.2.3 From 0860e09f5ff16ee3f097f6f9d444f277a38abd72 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 23:03:46 +0100 Subject: Extend SimpleHoster in multi-hoster plugins (3) --- module/plugins/hoster/UnrestrictLi.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index fcdbbd284..911061f24 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -38,6 +38,9 @@ class UnrestrictLi(SimpleHoster): __authors__ = [("stickell", "l.stickell@yahoo.it")] + MULTI_HOSTER = True + + def setup(self): self.chunkLimit = 16 self.resumeDownload = True -- cgit v1.2.3 From 87203e996fb42c172b15e29f0e394d5b328d9ac2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 23 Dec 2014 13:20:53 +0100 Subject: New plugin: MultiHoster --- module/plugins/hoster/UnrestrictLi.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 911061f24..36d866613 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -5,7 +5,7 @@ import re from datetime import datetime, timedelta from module.common.json_layer import json_loads -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo def secondsToMidnight(gmt=0): @@ -26,10 +26,10 @@ def secondsToMidnight(gmt=0): return int(res) -class UnrestrictLi(SimpleHoster): +class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' @@ -38,9 +38,6 @@ class UnrestrictLi(SimpleHoster): __authors__ = [("stickell", "l.stickell@yahoo.it")] - MULTI_HOSTER = True - - def setup(self): self.chunkLimit = 16 self.resumeDownload = True -- cgit v1.2.3 From a4786e340993bbfc5d2bf971c9bec18863d3dd80 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 23 Dec 2014 19:29:15 +0100 Subject: [MultiHoster] Update --- module/plugins/hoster/UnrestrictLi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 36d866613..7535d7b41 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -29,7 +29,7 @@ def secondsToMidnight(gmt=0): class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.16" + __version__ = "0.17" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' @@ -43,7 +43,7 @@ class UnrestrictLi(MultiHoster): self.resumeDownload = True - def handleMulti(self): + def handleFree(self): for _i in xrange(5): page = self.load('https://unrestrict.li/unrestrict.php', post={'link': self.pyfile.url, 'domain': 'long'}) -- cgit v1.2.3 From 136f63dc39603814b215606f888fb2e639021277 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 04:27:41 +0100 Subject: Spare code fixes --- module/plugins/hoster/UnrestrictLi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 7535d7b41..1476efa96 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -29,7 +29,7 @@ def secondsToMidnight(gmt=0): class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' @@ -38,6 +38,9 @@ class UnrestrictLi(MultiHoster): __authors__ = [("stickell", "l.stickell@yahoo.it")] + LOGIN_ACCOUNT = False + + def setup(self): self.chunkLimit = 16 self.resumeDownload = True -- cgit v1.2.3 From b6a2bd53628bd2824bac1dafc7b4eafdf3c815dd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:48:03 +0100 Subject: Update plugins after SimpleHoster changes --- module/plugins/hoster/UnrestrictLi.py | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 1476efa96..6e16cace7 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -6,30 +6,13 @@ from datetime import datetime, timedelta from module.common.json_layer import json_loads from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo - - -def secondsToMidnight(gmt=0): - now = datetime.utcnow() + timedelta(hours=gmt) - - if now.hour is 0 and now.minute < 10: - midnight = now - else: - midnight = now + timedelta(days=1) - - td = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now - - if hasattr(td, 'total_seconds'): - res = td.total_seconds() - else: #@NOTE: work-around for python 2.5 and 2.6 missing timedelta.total_seconds - res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 - - return int(res) +from module.plugins.internal.SimpleHoster import secondsToMidnight class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.18" + __version__ = "0.19" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' -- cgit v1.2.3 From 88568cf127542e2757d25705ecfdb2342b7c51b8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 30 Dec 2014 19:31:19 +0100 Subject: Update some MultiHoster __pattern__ --- module/plugins/hoster/UnrestrictLi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/UnrestrictLi.py') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 6e16cace7..c84f1daa7 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -12,9 +12,9 @@ from module.plugins.internal.SimpleHoster import secondsToMidnight class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.19" + __version__ = "0.20" - __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' + __pattern__ = r'https?://(?:www\.)?(unrestrict|unr)\.li/dl/[\w^_]+' __description__ = """Unrestrict.li hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3