diff options
author | Sergey M․ <dstftw@gmail.com> | 2018-04-24 23:49:30 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2018-04-24 23:54:49 +0700 |
commit | 1cc47c667419e0eadc0a6989256ab7b276852adf (patch) | |
tree | 7aae871998b25632bd5dcd1bb03d4f1511e995a1 /youtube_dl | |
parent | 99036a1298089068dcf80c0985bfcc3f8c24f281 (diff) |
[utils] Fix match_str for boolean meta fields
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 027d12785..574284e94 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2574,8 +2574,8 @@ def _match_one(filter_part, dct): return op(actual_value, comparison_value) UNARY_OPERATORS = { - '': lambda v: v is not None, - '!': lambda v: v is None, + '': lambda v: (v is True) if isinstance(v, bool) else (v is not None), + '!': lambda v: (v is False) if isinstance(v, bool) else (v is None), } operator_rex = re.compile(r'''(?x)\s* (?P<op>%s)\s*(?P<key>[a-z_]+) |