From: Yen Chi Hsuan Date: Wed, 13 Jan 2016 08:24:48 +0000 (+0800) Subject: [YoutubeDL] Introduce CSS3 like string operators X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=10d33b347391ed0af453a88d2860a8ad7d8d18c7;p=youtube-dl [YoutubeDL] Introduce CSS3 like string operators --- diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 0748fbba0..18b1443b8 100755 --- 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*(?Pext|acodec|vcodec|container|protocol)