projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04e88ca
)
[utils] Allow empty attribute values in get_element_by_attribute (Closes #9415)
author
Sergey M․
<dstftw@gmail.com>
Fri, 6 May 2016 16:07:30 +0000
(22:07 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 6 May 2016 16:07:30 +0000
(22:07 +0600)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index a5922b2b53306bda0cf4afccda7c17eeea85632c..6e45737843fbc2594227ac4699a3fce549b81e32 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-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>