From 65d290c21e5426f515684f624b8872dec7c0bec0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 23 Nov 2014 23:20:53 +0100 Subject: [SimpleHoster] Fix _getDirectLink routine --- module/plugins/internal/SimpleHoster.py | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'module/plugins/internal/SimpleHoster.py') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 01702d423..80ec2669b 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -19,7 +19,6 @@ from module.utils import fixup, parseFileSize statusMap = dict((v, k) for k, v in _statusMap.iteritems()) -#@TODO: Remove in 0.4.10 and redirect to self.error instead def _error(self, reason, type): if not reason and not type: type = "unknown" @@ -57,12 +56,13 @@ def parseHtmlTagAttrValue(attr_name, tag): return m.group(2) if m else None -def parseHtmlForm(attr_str, html, input_names=None): - for form in re.finditer(r"(?P]*%s[^>]*>)(?P.*?)]*>" % attr_str, +def parseHtmlForm(attr_str, html, input_names={}): + for form in re.finditer(r"(?P]*%s[^>]*>)(?P.*?)]*>" % attr_str, html, re.S | re.I): inputs = {} - action = parseHtmlTagAttrValue("action", form.group('tag')) - for inputtag in re.finditer(r'(<(input|textarea)[^>]*>)([^<]*(?=]*>)([^<]*(?=