1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-21 19:23:00 +08:00

[utils] Allow empty attribute values in get_element_by_attribute (Closes #9415)

This commit is contained in:
Sergey M․ 2016-05-06 22:07:30 +06:00
parent 04e88ca2ca
commit abc97b5eda
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -256,9 +256,9 @@ def get_element_by_attribute(attribute, value, html):
m = re.search(r'''(?xs)
<([a-zA-Z0-9:._-]+)
(?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]+|="[^"]+"|='[^']+'))*?
(?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'))*?
\s+%s=['"]?%s['"]?
(?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]+|="[^"]+"|='[^']+'))*?
(?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'))*?
\s*>
(?P<content>.*?)
</\1>