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 From 4709a41c176dd2947709b7f35ccc84213d574624 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Sep 2014 16:59:26 +0200 Subject: Rename SH flags --- 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 547f042e4..7f7104da1 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -32,7 +32,7 @@ class EgoFilesCom(SimpleHoster): self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) def process(self, pyfile): - if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): + if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): self.handlePremium() else: self.handleFree() -- 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/EgoFilesCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 7f7104da1..a99e43731 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -56,7 +56,7 @@ class EgoFilesCom(SimpleHoster): self.html = self.load(self.pyfile.url, post=post_data, decode=True) m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.logInfo('Wrong captcha') + self.logInfo("Wrong captcha") self.invalidCaptcha() elif hasattr(m, 'group'): downloadURL = m.group('link') @@ -73,7 +73,7 @@ class EgoFilesCom(SimpleHoster): def handlePremium(self): header = self.load(self.pyfile.url, just_header=True) if 'location' in header: - self.logDebug('DIRECT LINK from header: ' + header['location']) + self.logDebug("DIRECT LINK from header: " + header['location']) self.download(header['location']) else: self.html = self.load(self.pyfile.url, decode=True) @@ -82,7 +82,7 @@ class EgoFilesCom(SimpleHoster): if m is None: self.parseError('Unable to detect direct download url') else: - self.logDebug('DIRECT URL from html: ' + m.group('link')) + self.logDebug("DIRECT URL from html: " + m.group('link')) self.download(m.group('link'), disposition=True) -- cgit v1.2.3 From 23ae563604dca1dae262fbc598154b99b2f1eae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 09:06:05 +0200 Subject: Update plugins after CaptchaService and XFileSharingPro changes --- module/plugins/hoster/EgoFilesCom.py | 9 +++++++-- 1 file changed, 7 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 a99e43731..49667a722 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -24,7 +24,6 @@ class EgoFilesCom(SimpleHoster): 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)?' LINK_PATTERN = r'Download >' - RECAPTCHA_KEY = "6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX" def setup(self): @@ -48,9 +47,15 @@ class EgoFilesCom(SimpleHoster): self.wait(waittime, True) downloadURL = r'' + recaptcha = ReCaptcha(self) + + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") + for _ in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + challenge, response = recaptcha.challenge(captcha_key) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response} self.html = self.load(self.pyfile.url, post=post_data, decode=True) -- cgit v1.2.3 From 8ddad37bf72ad371a0dbb571fa63ed73e2724cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 4 Oct 2014 23:29:53 +0200 Subject: [EgoFilesCom] Mark dead --- module/plugins/hoster/EgoFilesCom.py | 84 ++---------------------------------- 1 file changed, 4 insertions(+), 80 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 49667a722..2da71c46b 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -1,94 +1,18 @@ # -*- coding: utf-8 -*- -# -# Test links: -# http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin -import re +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - -class EgoFilesCom(SimpleHoster): +class EgoFilesCom(DeadHoster): __name__ = "EgoFilesCom" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" - __pattern__ = r'https?://(?:www\.)?egofiles.com/(\w+)' + __pattern__ = r'https?://(?:www\.)?egofiles\.com/\w+' __description__ = """Egofiles.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - 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)?' - LINK_PATTERN = r'Download >' - - - def setup(self): - # Set English language - self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) - - def process(self, pyfile): - if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): - self.handlePremium() - else: - self.handleFree() - - def handleFree(self): - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - - # Wait time between free downloads - if 'For next free download you have to wait' in self.html: - m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0') - waittime = int(m['m']) * 60 + int(m['s']) - self.wait(waittime, True) - - downloadURL = r'' - - recaptcha = ReCaptcha(self) - - captcha_key = recaptcha.detect_key() - if captcha_key is None: - self.parseError("ReCaptcha key not found") - - for _ in xrange(5): - challenge, response = recaptcha.challenge(captcha_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.LINK_PATTERN, self.html) - if m is None: - self.logInfo("Wrong captcha") - self.invalidCaptcha() - elif hasattr(m, 'group'): - downloadURL = m.group('link') - self.correctCaptcha() - break - else: - self.fail('Unknown error - Plugin may be out of date') - - if not downloadURL: - self.fail("No Download url retrieved/all captcha attempts failed") - - self.download(downloadURL, disposition=True) - - def handlePremium(self): - header = self.load(self.pyfile.url, just_header=True) - if 'location' in header: - self.logDebug("DIRECT LINK from header: " + header['location']) - self.download(header['location']) - else: - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - m = re.search(r'Download >', self.html) - if m is None: - self.parseError('Unable to detect direct download url') - else: - self.logDebug("DIRECT URL from html: " + m.group('link')) - self.download(m.group('link'), disposition=True) - getInfo = create_getInfo(EgoFilesCom) -- 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/EgoFilesCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 2da71c46b..35cdd17b3 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -11,8 +11,7 @@ class EgoFilesCom(DeadHoster): __pattern__ = r'https?://(?:www\.)?egofiles\.com/\w+' __description__ = """Egofiles.com hoster plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] getInfo = create_getInfo(EgoFilesCom) -- 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/EgoFilesCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 35cdd17b3..835d7994a 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -11,6 +11,7 @@ class EgoFilesCom(DeadHoster): __pattern__ = r'https?://(?:www\.)?egofiles\.com/\w+' __description__ = """Egofiles.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] -- 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/EgoFilesCom.py | 8 ++++---- 1 file changed, 4 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 835d7994a..9a2f50ed4 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -4,15 +4,15 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class EgoFilesCom(DeadHoster): - __name__ = "EgoFilesCom" - __type__ = "hoster" + __name__ = "EgoFilesCom" + __type__ = "hoster" __version__ = "0.16" __pattern__ = r'https?://(?:www\.)?egofiles\.com/\w+' __description__ = """Egofiles.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] getInfo = create_getInfo(EgoFilesCom) -- cgit v1.2.3