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/Keep2shareCC.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/Keep2shareCC.py') diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index a7f1efdb8..e9f294087 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -35,7 +35,7 @@ class Keep2shareCC(SimpleHoster): FILE_NAME_PATTERN = r'File: (?P.+)' FILE_SIZE_PATTERN = r'Size: (?P[^<]+)' - FILE_OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' + OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' DIRECT_LINK_PATTERN = r'To download this file with slow speed, use this link' WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' -- 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/Keep2shareCC.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/Keep2shareCC.py') diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index e9f294087..74dc05b89 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -37,11 +37,12 @@ class Keep2shareCC(SimpleHoster): FILE_SIZE_PATTERN = r'Size: (?P[^<]+)' OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' - DIRECT_LINK_PATTERN = r'To download this file with slow speed, use this link' + LINK_PATTERN = r'To download this file with slow speed, use this link' WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' ALREADY_DOWNLOADING_PATTERN = r'Free account does not allow to download more than one file at the same time' - RECAPTCHA_KEY = '6LcYcN0SAAAAABtMlxKj7X0hRxOY8_2U86kI1vbb' + RECAPTCHA_KEY = "6LcYcN0SAAAAABtMlxKj7X0hRxOY8_2U86kI1vbb" + def handleFree(self): self.sanitize_url() @@ -76,7 +77,7 @@ class Keep2shareCC(SimpleHoster): self.wait(30 * 60, reconnect=True) self.retry() - m = re.search(self.DIRECT_LINK_PATTERN, self.html) + m = re.search(self.LINK_PATTERN, self.html) if not m: self.parseError("Unable to detect direct link") self.startDownload(m.group(1)) -- 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/Keep2shareCC.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/Keep2shareCC.py') diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index 74dc05b89..12df08743 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -78,7 +78,7 @@ class Keep2shareCC(SimpleHoster): self.retry() m = re.search(self.LINK_PATTERN, self.html) - if not m: + if m is None: self.parseError("Unable to detect direct link") self.startDownload(m.group(1)) -- 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/Keep2shareCC.py | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'module/plugins/hoster/Keep2shareCC.py') diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index 12df08743..c1ec66435 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -1,34 +1,23 @@ # -*- 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 . # -############################################################################ - -# Test links (random.bin): +# +# Test links: # http://k2s.cc/file/55fb73e1c00c5/random.bin import re + from urlparse import urlparse, urljoin -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class Keep2shareCC(SimpleHoster): __name__ = "Keep2shareCC" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' __version__ = "0.10" + + __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' + __description__ = """Keep2share.cc hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" -- cgit v1.2.3