mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-25 17:16:46 +00:00
[YoutubeDL] Introduce CSS3 like string operators
This commit is contained in:
parent
ac25992bc7
commit
10d33b3473
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue