From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/NowDownloadEu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index cc1a10da0..4619c035d 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -32,7 +32,7 @@ class NowDownloadEu(SimpleHoster): __author_mail__ = ("soilfiction@gmail.com", "vuolter@gmail.com") FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[0-9,.]+) (?P[kKMG])i?B ' - FILE_OFFLINE_PATTERN = r'(This file does not exist!)' + OFFLINE_PATTERN = r'(This file does not exist!)' FILE_TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' -- cgit v1.2.3 From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/NowDownloadEu.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 4619c035d..c6154c0e0 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -33,24 +33,26 @@ class NowDownloadEu(SimpleHoster): FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[0-9,.]+) (?P[kKMG])i?B ' OFFLINE_PATTERN = r'(This file does not exist!)' - FILE_TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' - FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' - FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' - FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' + + TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' + CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' + WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' + LINK_PATTERN = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] + def setup(self): self.multiDL = self.resumeDownload = True self.chunkLimit = -1 def handleFree(self): - tokenlink = re.search(self.FILE_TOKEN_PATTERN, self.html) - continuelink = re.search(self.FILE_CONTINUE_PATTERN, self.html) + tokenlink = re.search(self.TOKEN_PATTERN, self.html) + continuelink = re.search(self.CONTINUE_PATTERN, self.html) if not tokenlink or not continuelink: self.fail('Plugin out of Date') - found = re.search(self.FILE_WAIT_PATTERN, self.html) + found = re.search(self.WAIT_PATTERN, self.html) if found: wait = int(found.group(1)) else: @@ -62,7 +64,7 @@ class NowDownloadEu(SimpleHoster): self.html = self.load(baseurl + str(continuelink.group(1))) - url = re.search(self.FILE_DOWNLOAD_LINK, self.html) + url = re.search(self.LINK_PATTERN, self.html) if not url: self.fail('Download Link not Found (Plugin out of Date?)') self.logDebug('Download link: ' + str(url.group(1))) -- cgit v1.2.3 From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/NowDownloadEu.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index c6154c0e0..d5cd7f1c6 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ import re -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/NowDownloadEu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index d5cd7f1c6..20153d356 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -47,7 +47,7 @@ class NowDownloadEu(SimpleHoster): def handleFree(self): tokenlink = re.search(self.TOKEN_PATTERN, self.html) continuelink = re.search(self.CONTINUE_PATTERN, self.html) - if not tokenlink or not continuelink: + if tokenlink is None or continuelink is None: self.fail('Plugin out of Date') found = re.search(self.WAIT_PATTERN, self.html) @@ -63,7 +63,7 @@ class NowDownloadEu(SimpleHoster): self.html = self.load(baseurl + str(continuelink.group(1))) url = re.search(self.LINK_PATTERN, self.html) - if not url: + if url is None: self.fail('Download Link not Found (Plugin out of Date?)') self.logDebug('Download link: ' + str(url.group(1))) self.download(str(url.group(1))) -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/NowDownloadEu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 20153d356..cf4f46805 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -50,9 +50,9 @@ class NowDownloadEu(SimpleHoster): if tokenlink is None or continuelink is None: self.fail('Plugin out of Date') - found = re.search(self.WAIT_PATTERN, self.html) - if found: - wait = int(found.group(1)) + m = re.search(self.WAIT_PATTERN, self.html) + if m: + wait = int(m.group(1)) else: wait = 60 -- 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/NowDownloadEu.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index cf4f46805..193698f17 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - import re + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.utils import fixup @@ -23,8 +9,10 @@ from module.utils import fixup class NowDownloadEu(SimpleHoster): __name__ = "NowDownloadEu" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?nowdownload\.(ch|co|eu|sx)/(dl/|download\.php\?id=)(?P\w+)' __version__ = "0.05" + + __pattern__ = r'http://(?:www\.)?nowdownload\.(ch|co|eu|sx)/(dl/|download\.php\?id=)(?P\w+)' + __description__ = """NowDownload.ch hoster plugin""" __author_name__ = ("godofdream", "Walter Purcaro") __author_mail__ = ("soilfiction@gmail.com", "vuolter@gmail.com") -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hoster/NowDownloadEu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 193698f17..5ad02b81b 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -53,7 +53,7 @@ class NowDownloadEu(SimpleHoster): url = re.search(self.LINK_PATTERN, self.html) if url is None: self.fail('Download Link not Found (Plugin out of Date?)') - self.logDebug('Download link: ' + str(url.group(1))) + self.logDebug("Download link", url.group(1)) self.download(str(url.group(1))) -- 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/NowDownloadEu.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 5ad02b81b..5e97add30 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -14,8 +14,9 @@ class NowDownloadEu(SimpleHoster): __pattern__ = r'http://(?:www\.)?nowdownload\.(ch|co|eu|sx)/(dl/|download\.php\?id=)(?P\w+)' __description__ = """NowDownload.ch hoster plugin""" - __author_name__ = ("godofdream", "Walter Purcaro") - __author_mail__ = ("soilfiction@gmail.com", "vuolter@gmail.com") + __authors__ = [("godofdream", "soilfiction@gmail.com"), + ("Walter Purcaro", "vuolter@gmail.com")] + FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[0-9,.]+) (?P[kKMG])i?B ' OFFLINE_PATTERN = r'(This file does not exist!)' -- 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/NowDownloadEu.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 5e97add30..f3da3033f 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -14,6 +14,7 @@ class NowDownloadEu(SimpleHoster): __pattern__ = r'http://(?:www\.)?nowdownload\.(ch|co|eu|sx)/(dl/|download\.php\?id=)(?P\w+)' __description__ = """NowDownload.ch hoster plugin""" + __license__ = "GPLv3" __authors__ = [("godofdream", "soilfiction@gmail.com"), ("Walter Purcaro", "vuolter@gmail.com")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/hoster/NowDownloadEu.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index f3da3033f..2bde071ab 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -19,13 +19,13 @@ class NowDownloadEu(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[0-9,.]+) (?P[kKMG])i?B ' + FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[\d.,]+) (?P\w+) ' OFFLINE_PATTERN = r'(This file does not exist!)' - TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' - CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' + TOKEN_PATTERN = r'"(/api/token\.php\?token=\w+)"' + CONTINUE_PATTERN = r'"(/dl2/\w+/\w+)"' WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' - LINK_PATTERN = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' + LINK_PATTERN = r'"(http://f\d+\.nowdownload\.ch/dl/\w+/\w+)' FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] -- cgit v1.2.3 From 388a2f6478d42e423f1f8442d8539983f3762f22 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:38:49 +0200 Subject: Improve unit detection in size pattern --- module/plugins/hoster/NowDownloadEu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 2bde071ab..b2c98dc40 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -19,7 +19,7 @@ class NowDownloadEu(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[\d.,]+) (?P\w+) ' + FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[\d.,]+) (?P[\w^_]+) ' OFFLINE_PATTERN = r'(This file does not exist!)' TOKEN_PATTERN = r'"(/api/token\.php\?token=\w+)"' -- cgit v1.2.3 From d6ac1dccae1c0975d97d1a6374aa9f349a0034a7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 15 Oct 2014 02:08:14 +0200 Subject: New hoster NowVideoAt --- module/plugins/hoster/NowDownloadEu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index b2c98dc40..dcf13e678 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -11,21 +11,21 @@ class NowDownloadEu(SimpleHoster): __type__ = "hoster" __version__ = "0.05" - __pattern__ = r'http://(?:www\.)?nowdownload\.(ch|co|eu|sx)/(dl/|download\.php\?id=)(?P\w+)' + __pattern__ = r'http://(?:www\.)?nowdownload\.(at|ch|co|eu|sx)/(dl/|download\.php\?id=)\w+' - __description__ = """NowDownload.ch hoster plugin""" + __description__ = """NowDownload.at hoster plugin""" __license__ = "GPLv3" __authors__ = [("godofdream", "soilfiction@gmail.com"), ("Walter Purcaro", "vuolter@gmail.com")] FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[\d.,]+) (?P[\w^_]+) ' - OFFLINE_PATTERN = r'(This file does not exist!)' + OFFLINE_PATTERN = r'>This file does not exist' TOKEN_PATTERN = r'"(/api/token\.php\?token=\w+)"' CONTINUE_PATTERN = r'"(/dl2/\w+/\w+)"' WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' - LINK_PATTERN = r'"(http://f\d+\.nowdownload\.ch/dl/\w+/\w+)' + LINK_PATTERN = r'"(http://f\d+\.nowdownload\.at/dl/\w+/\w+)' FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] @@ -46,7 +46,7 @@ class NowDownloadEu(SimpleHoster): else: wait = 60 - baseurl = "http://www.nowdownload.ch" + baseurl = "http://www.nowdownload.at" self.html = self.load(baseurl + str(tokenlink.group(1))) self.wait(wait) -- cgit v1.2.3 From 1f48f481740863c7697064bde286a78e977e4a1b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 15:12:06 +0200 Subject: Update other plugins to support self.error --- module/plugins/hoster/NowDownloadEu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index dcf13e678..57d31acd5 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -38,7 +38,7 @@ class NowDownloadEu(SimpleHoster): tokenlink = re.search(self.TOKEN_PATTERN, self.html) continuelink = re.search(self.CONTINUE_PATTERN, self.html) if tokenlink is None or continuelink is None: - self.fail('Plugin out of Date') + self.error() m = re.search(self.WAIT_PATTERN, self.html) if m: @@ -54,7 +54,7 @@ class NowDownloadEu(SimpleHoster): url = re.search(self.LINK_PATTERN, self.html) if url is None: - self.fail('Download Link not Found (Plugin out of Date?)') + self.error("Download link not found") self.logDebug("Download link", url.group(1)) self.download(str(url.group(1))) -- 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/NowDownloadEu.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 57d31acd5..256b2c801 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -34,6 +34,7 @@ class NowDownloadEu(SimpleHoster): self.multiDL = self.resumeDownload = True self.chunkLimit = -1 + def handleFree(self): tokenlink = re.search(self.TOKEN_PATTERN, self.html) continuelink = re.search(self.CONTINUE_PATTERN, self.html) -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/NowDownloadEu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 256b2c801..59ca68258 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -56,7 +56,7 @@ class NowDownloadEu(SimpleHoster): url = re.search(self.LINK_PATTERN, self.html) if url is None: self.error("Download link not found") - self.logDebug("Download link", url.group(1)) + self.download(str(url.group(1))) -- 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/NowDownloadEu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 59ca68258..c3867a2f5 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -55,7 +55,7 @@ class NowDownloadEu(SimpleHoster): url = re.search(self.LINK_PATTERN, self.html) if url is None: - self.error("Download link not found") + self.error(_("Download link not found")) self.download(str(url.group(1))) -- 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/NowDownloadEu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index c3867a2f5..8f53ecb7a 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -7,16 +7,16 @@ from module.utils import fixup class NowDownloadEu(SimpleHoster): - __name__ = "NowDownloadEu" - __type__ = "hoster" + __name__ = "NowDownloadEu" + __type__ = "hoster" __version__ = "0.05" __pattern__ = r'http://(?:www\.)?nowdownload\.(at|ch|co|eu|sx)/(dl/|download\.php\?id=)\w+' __description__ = """NowDownload.at hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("godofdream", "soilfiction@gmail.com"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("godofdream", "soilfiction@gmail.com"), + ("Walter Purcaro", "vuolter@gmail.com")] FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[\d.,]+) (?P[\w^_]+) ' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/NowDownloadEu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 8f53ecb7a..287026460 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -19,7 +19,7 @@ class NowDownloadEu(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - FILE_INFO_PATTERN = r'Downloading
(?P.*) (?P[\d.,]+) (?P[\w^_]+) ' + INFO_PATTERN = r'Downloading
(?P.*) (?P[\d.,]+) (?P[\w^_]+) ' OFFLINE_PATTERN = r'>This file does not exist' TOKEN_PATTERN = r'"(/api/token\.php\?token=\w+)"' @@ -27,7 +27,7 @@ class NowDownloadEu(SimpleHoster): WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' LINK_PATTERN = r'"(http://f\d+\.nowdownload\.at/dl/\w+/\w+)' - FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] + NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] def setup(self): -- cgit v1.2.3 From ca0ce20d5a805080f69dad4c24997ace1958bbcb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Dec 2014 17:18:40 +0100 Subject: Plugin code cosmetics --- module/plugins/hoster/NowDownloadEu.py | 63 ---------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 module/plugins/hoster/NowDownloadEu.py (limited to 'module/plugins/hoster/NowDownloadEu.py') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py deleted file mode 100644 index 287026460..000000000 --- a/module/plugins/hoster/NowDownloadEu.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.utils import fixup - - -class NowDownloadEu(SimpleHoster): - __name__ = "NowDownloadEu" - __type__ = "hoster" - __version__ = "0.05" - - __pattern__ = r'http://(?:www\.)?nowdownload\.(at|ch|co|eu|sx)/(dl/|download\.php\?id=)\w+' - - __description__ = """NowDownload.at hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("godofdream", "soilfiction@gmail.com"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - INFO_PATTERN = r'Downloading
(?P.*) (?P[\d.,]+) (?P[\w^_]+) ' - OFFLINE_PATTERN = r'>This file does not exist' - - TOKEN_PATTERN = r'"(/api/token\.php\?token=\w+)"' - CONTINUE_PATTERN = r'"(/dl2/\w+/\w+)"' - WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' - LINK_PATTERN = r'"(http://f\d+\.nowdownload\.at/dl/\w+/\w+)' - - NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] - - - def setup(self): - self.multiDL = self.resumeDownload = True - self.chunkLimit = -1 - - - def handleFree(self): - tokenlink = re.search(self.TOKEN_PATTERN, self.html) - continuelink = re.search(self.CONTINUE_PATTERN, self.html) - if tokenlink is None or continuelink is None: - self.error() - - m = re.search(self.WAIT_PATTERN, self.html) - if m: - wait = int(m.group(1)) - else: - wait = 60 - - baseurl = "http://www.nowdownload.at" - self.html = self.load(baseurl + str(tokenlink.group(1))) - self.wait(wait) - - self.html = self.load(baseurl + str(continuelink.group(1))) - - url = re.search(self.LINK_PATTERN, self.html) - if url is None: - self.error(_("Download link not found")) - - self.download(str(url.group(1))) - - -getInfo = create_getInfo(NowDownloadEu) -- cgit v1.2.3