diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2017-07-05 23:23:35 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2017-07-05 23:27:12 +0800 |
commit | 609ff8ca19f1c4c168a81121074b91cc0f0d4c47 (patch) | |
tree | b2563ed9960c812ca25f93bb4b08cff64a9e2a49 /youtube_dl/utils.py | |
parent | b6c9fe416243373bcb59eb8aa5ef0baca8f3c97c (diff) |
[utils] Support attributes with no values in get_elements_by_attribute()
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 39860e9d1..fdf5e29e7 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -365,9 +365,9 @@ def get_elements_by_attribute(attribute, value, html, escape_value=True): retlist = [] for m in re.finditer(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> |