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/FastshareCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FastshareCz.py') diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index c7841a237..996dea2f5 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -35,7 +35,7 @@ class FastshareCz(SimpleHoster): __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com") FILE_INFO_PATTERN = r'

(?P[^<]+)

\s*
\s*Size\s*: (?P\d+) (?P\w+),' - FILE_OFFLINE_PATTERN = '>(The file has been deleted|Requested page not found)' + OFFLINE_PATTERN = '>(The file has been deleted|Requested page not found)' FILE_URL_REPLACEMENTS = [("#.*", "")] SH_COOKIES = [(".fastshare.cz", "lang", "en")] -- 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/FastshareCz.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FastshareCz.py') diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 996dea2f5..c7008ccd0 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -35,14 +35,16 @@ class FastshareCz(SimpleHoster): __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com") FILE_INFO_PATTERN = r'

(?P[^<]+)

\s*
\s*Size\s*: (?P\d+) (?P\w+),' - OFFLINE_PATTERN = '>(The file has been deleted|Requested page not found)' + OFFLINE_PATTERN = r'>(The file has been deleted|Requested page not found)' FILE_URL_REPLACEMENTS = [("#.*", "")] + SH_COOKIES = [(".fastshare.cz", "lang", "en")] FREE_URL_PATTERN = r'action=(/free/.*?)>\s* 100% of FREE slots are full" in self.html: -- 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/FastshareCz.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/FastshareCz.py') diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index c7008ccd0..c4112534c 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -12,8 +12,6 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -# -# @author: zoidberg ############################################################################### # Test links (random.bin): -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/FastshareCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FastshareCz.py') diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index c4112534c..4acbb12f8 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -72,7 +72,7 @@ class FastshareCz(SimpleHoster): def handlePremium(self): header = self.load(self.pyfile.url, just_header=True) if "location" in header: - url = header["location"] + url = header['location'] else: self.html = self.load(self.pyfile.url) -- 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/FastshareCz.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/FastshareCz.py') diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 4acbb12f8..e1fd9a666 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -48,9 +48,9 @@ class FastshareCz(SimpleHoster): if "> 100% of FREE slots are full" in self.html: self.retry(120, 60, "No free slots") - found = re.search(self.FREE_URL_PATTERN, self.html) - if found: - action, captcha_src = found.groups() + m = re.search(self.FREE_URL_PATTERN, self.html) + if m: + action, captcha_src = m.groups() else: self.parseError("Free URL") @@ -82,9 +82,9 @@ class FastshareCz(SimpleHoster): self.logWarning("Not enough traffic left") self.resetAccount() else: - found = re.search(self.PREMIUM_URL_PATTERN, self.html) - if found: - url = found.group(1) + m = re.search(self.PREMIUM_URL_PATTERN, self.html) + if m: + url = m.group(1) else: self.parseError("Premium URL") -- 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/FastshareCz.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/FastshareCz.py') diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index e1fd9a666..7a847fdc4 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -1,23 +1,10 @@ # -*- 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://www.fastshare.cz/2141189/random.bin import re + from urlparse import urljoin from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -26,8 +13,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+' __version__ = "0.22" + + __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+' + __description__ = """FastShare.cz hoster plugin""" __author_name__ = ("zoidberg", "stickell", "Walter Purcaro") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com") -- cgit v1.2.3