projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[utils] Support attributes with no values in get_elements_by_attribute()
[youtube-dl]
/
youtube_dl
/
utils.py
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 1973bd4836a407d3e66fcc4c3a54d052e958ae19..fdf5e29e7d417b94ba7f83129a8420f93ed31217 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-22,7
+22,6
@@
import locale
import math
import operator
import os
import math
import operator
import os
-import pipes
import platform
import random
import re
import platform
import random
import re
@@
-366,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:._-]+)
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+%s=['"]?%s['"]?
- (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'))*?
+ (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'
|
))*?
\s*>
(?P<content>.*?)
</\1>
\s*>
(?P<content>.*?)
</\1>
@@
-1535,7
+1534,7
@@
def shell_quote(args):
if isinstance(a, bytes):
# We may get a filename encoded with 'encodeFilename'
a = a.decode(encoding)
if isinstance(a, bytes):
# We may get a filename encoded with 'encodeFilename'
a = a.decode(encoding)
- quoted_args.append(
pipes.
quote(a))
+ quoted_args.append(
compat_shlex_
quote(a))
return ' '.join(quoted_args)
return ' '.join(quoted_args)