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/FilerNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index d39666922..9a2bbafbf 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -36,7 +36,7 @@ class FilerNet(SimpleHoster): __author_mail__ = "l.stickell@yahoo.it" FILE_INFO_PATTERN = r'

Free Download (?P\S+) (?P[\w.]+) (?P\w+)

' - FILE_OFFLINE_PATTERN = r'Nicht gefunden' + OFFLINE_PATTERN = r'Nicht gefunden' RECAPTCHA_KEY = '6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V' DIRECT_LINK_PATTERN = r'href="([^"]+)">Get download' -- 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/FilerNet.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 9a2bbafbf..72396fac6 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -37,8 +37,9 @@ class FilerNet(SimpleHoster): FILE_INFO_PATTERN = r'

Free Download (?P\S+) (?P[\w.]+) (?P\w+)

' OFFLINE_PATTERN = r'Nicht gefunden' - RECAPTCHA_KEY = '6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V' - DIRECT_LINK_PATTERN = r'href="([^"]+)">Get download' + RECAPTCHA_KEY = "6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V" + LINK_PATTERN = r'href="([^"]+)">Get download' + def process(self, pyfile): if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): @@ -74,7 +75,7 @@ class FilerNet(SimpleHoster): hash_data = inputs['hash'] self.logDebug('Hash: ' + hash_data) - downloadURL = '' + downloadURL = r'' recaptcha = ReCaptcha(self) for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) @@ -107,7 +108,7 @@ class FilerNet(SimpleHoster): dl = self.pyfile.url else: # Direct Download OFF html = self.load(self.pyfile.url) - m = re.search(self.DIRECT_LINK_PATTERN, html) + m = re.search(self.LINK_PATTERN, html) if not m: self.parseError("Unable to detect direct link, try to enable 'Direct download' in your user settings") dl = 'http://filer.net' + 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/FilerNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 72396fac6..91805ca40 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -109,7 +109,7 @@ class FilerNet(SimpleHoster): else: # Direct Download OFF html = self.load(self.pyfile.url) m = re.search(self.LINK_PATTERN, html) - if not m: + if m is None: self.parseError("Unable to detect direct link, try to enable 'Direct download' in your user settings") dl = 'http://filer.net' + 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/FilerNet.py | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 91805ca40..a36607f8a 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -1,36 +1,25 @@ # -*- 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://filer.net/get/ivgf5ztw53et3ogd # http://filer.net/get/hgo14gzcng3scbvv import pycurl import re + from urlparse import 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 FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?filer\.net/get/(\w+)' __version__ = "0.03" + + __pattern__ = r'https?://(?:www\.)?filer\.net/get/(\w+)' + __description__ = """Filer.net hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" -- cgit v1.2.3