projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac25992
)
[YoutubeDL] Introduce CSS3 like string operators
author
Yen Chi Hsuan
<yan12125@gmail.com>
Wed, 13 Jan 2016 08:24:48 +0000
(16:24 +0800)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 16 Jan 2016 03:53:12 +0000
(09:53 +0600)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index 0748fbba0262cb29b90b73bba749d802f2b3bcc1..18b1443b887ca323e87348636c0febbb878705cc 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-898,6
+898,9
@@
class YoutubeDL(object):
STR_OPERATORS = {
'=': operator.eq,
'!=': operator.ne,
+ '^=': lambda attr, value: attr.startswith(value),
+ '$=': lambda attr, value: attr.endswith(value),
+ '*=': lambda attr, value: value in attr,
}
str_operator_rex = re.compile(r'''(?x)
\s*(?P<key>ext|acodec|vcodec|container|protocol)