[YoutubeDL] Introduce CSS3 like string operators

pull/2/head
Yen Chi Hsuan 9 years ago committed by Sergey M․
parent ac25992bc7
commit 10d33b3473

@ -898,6 +898,9 @@ class YoutubeDL(object):
STR_OPERATORS = { STR_OPERATORS = {
'=': operator.eq, '=': operator.eq,
'!=': operator.ne, '!=': 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) str_operator_rex = re.compile(r'''(?x)
\s*(?P<key>ext|acodec|vcodec|container|protocol) \s*(?P<key>ext|acodec|vcodec|container|protocol)

Loading…
Cancel
Save