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/EgoFilesCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 68a95b33a..000a89901 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -33,7 +33,7 @@ class EgoFilesCom(SimpleHoster): __author_mail__ = "l.stickell@yahoo.it" FILE_INFO_PATTERN = r'
\s+(?P[^\t]+)\s+
\s+(File size|Rozmiar): (?P[\w.]+) (?P\w+) \|' - FILE_OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' + OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' WAIT_TIME_PATTERN = r'For next free download you have to wait ((?P\d*)m)? ?((?P\d+)s)?' DIRECT_LINK_PATTERN = r'Download >' RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' -- 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/EgoFilesCom.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 000a89901..2a7c3c508 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -35,8 +35,9 @@ class EgoFilesCom(SimpleHoster): FILE_INFO_PATTERN = r'
\s+(?P[^\t]+)\s+
\s+(File size|Rozmiar): (?P[\w.]+) (?P\w+) \|' OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' WAIT_TIME_PATTERN = r'For next free download you have to wait ((?P\d*)m)? ?((?P\d+)s)?' - DIRECT_LINK_PATTERN = r'Download >' - RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' + LINK_PATTERN = r'Download >' + RECAPTCHA_KEY = "6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX" + def setup(self): # Set English language @@ -58,14 +59,14 @@ class EgoFilesCom(SimpleHoster): waittime = int(m['m']) * 60 + int(m['s']) self.wait(waittime, True) - downloadURL = '' + downloadURL = r'' recaptcha = ReCaptcha(self) for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response} self.html = self.load(self.pyfile.url, post=post_data, decode=True) - m = re.search(self.DIRECT_LINK_PATTERN, self.html) + m = re.search(self.LINK_PATTERN, self.html) if not m: self.logInfo('Wrong captcha') self.invalidCaptcha() -- 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/EgoFilesCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 2a7c3c508..f4fdda5a3 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -67,7 +67,7 @@ class EgoFilesCom(SimpleHoster): 'recaptcha_response_field': response} self.html = self.load(self.pyfile.url, post=post_data, decode=True) m = re.search(self.LINK_PATTERN, self.html) - if not m: + if m is None: self.logInfo('Wrong captcha') self.invalidCaptcha() elif hasattr(m, 'group'): @@ -91,7 +91,7 @@ class EgoFilesCom(SimpleHoster): self.html = self.load(self.pyfile.url, decode=True) self.getFileInfo() m = re.search(r'Download >', self.html) - if not m: + if m is None: self.parseError('Unable to detect direct download url') else: self.logDebug('DIRECT URL from html: ' + m.group('link')) -- 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/EgoFilesCom.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index f4fdda5a3..547f042e4 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -1,33 +1,21 @@ # -*- 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 link (random.bin): +# +# Test links: # http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin import re -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 EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?egofiles.com/(\w+)' __version__ = "0.15" + + __pattern__ = r'https?://(?:www\.)?egofiles.com/(\w+)' + __description__ = """Egofiles.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" -- cgit v1.2.3