projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a41fb80
)
[utils] Relax attribute key assert
author
Sergey M․
<dstftw@gmail.com>
Fri, 4 Sep 2015 17:57:27 +0000
(23:57 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 4 Sep 2015 17:57:27 +0000
(23:57 +0600)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index de5069c7b39834666209fa2dfb7ab38db9a803f1..86b75710300251379cca9b31cacaecc5cb43c6ed 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-141,7
+141,7
@@
def write_json_file(obj, fn):
if sys.version_info >= (2, 7):
def find_xpath_attr(node, xpath, key, val=None):
""" Find the xpath xpath[@key=val] """
- assert re.match(r'^[a-zA-Z-]+$', key)
+ assert re.match(r'^[a-zA-Z
_
-]+$', key)
if val:
assert re.match(r'^[a-zA-Z0-9@\s:._-]*$', val)
expr = xpath + ('[@%s]' % key if val is None else "[@%s='%s']" % (key, val))