summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/SimpleHoster.py
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-08-12 00:38:07 +0200
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-08-12 00:38:07 +0200
commit3e16daf0a12fc43c2087300a02560879688c7f18 (patch)
tree7f940496596d888056efeb1794d9f9b29296b36a /module/plugins/internal/SimpleHoster.py
parentcoolshare.cz + warserver.cz premium support (diff)
downloadpyload-3e16daf0a12fc43c2087300a02560879688c7f18.tar.xz
update depositfiles, easybytes, add ryushare
Diffstat (limited to 'module/plugins/internal/SimpleHoster.py')
-rw-r--r--module/plugins/internal/SimpleHoster.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 09b496aa9..566615120 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -40,18 +40,23 @@ def set_cookies(cj, cookies):
def parseHtmlTagAttrValue(attr_name, tag):
m = re.search(r"%s\s*=\s*([\"']?)((?<=\")[^\"]+|(?<=')[^']+|[^\s\"'][^>\s]+)\1" % attr_name, tag)
- return m.group(2) if m else ''
-
+ return m.group(2) if m else None
+
def parseHtmlForm(attr_str, html):
inputs = {}
action = None
form = re.search(r"(?P<tag><form[^>]*%s[^>]*>)(?P<content>.*?)</(form|body|html)[^>]*>" % attr_str, html, re.S | re.I)
if form:
action = parseHtmlTagAttrValue("action", form.group('tag'))
- for input in re.finditer(r'(<(?:input|textarea)[^>]*>)', form.group('content'), re.S | re.I):
+ for input in re.finditer(r'(<(input|textarea)[^>]*>)([^<]*(?=</\2)|)', form.group('content'), re.S | re.I):
name = parseHtmlTagAttrValue("name", input.group(1))
if name:
- inputs[name] = parseHtmlTagAttrValue("value", input.group(1))
+ value = parseHtmlTagAttrValue("value", input.group(1))
+ if value is None:
+ inputs[name] = input.group(3) or ''
+ else:
+ inputs[name] = value
+
return action, inputs
def parseFileInfo(self, url = '', html = ''):
@@ -124,7 +129,7 @@ class PluginParseError(Exception):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
- __version__ = "0.24"
+ __version__ = "0.25"
__pattern__ = None
__type__ = "hoster"
__description__ = """Base hoster plugin"""