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