Repository: yt-dlp
Issue: --match-filter !is_live generates python "< not supported" error
Labels: docs/meta/cleanup

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Provide a description that is worded well enough to be understood

`--match-filter "duration<600 & !is_live"` generates python errors.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', '--match-filter', 'duration<600 \\& \\!is_live', 'https://www.youtube.com/watch?v=O9nejN42ZFY']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.07.06 [b532a3481] (pip)
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-82-generic-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2020.06.20, mutagen-1.46.0, secretstorage-3.3.1, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.07.06, Current version: stable@2023.07.06
yt-dlp is up to date (stable@2023.07.06)
[youtube] Extracting URL: https://www.youtube.com/watch?v=O9nejN42ZFY
[youtube] O9nejN42ZFY: Downloading webpage
WARNING: [youtube] unable to extract initial player response; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
[youtube] O9nejN42ZFY: Downloading ios player API JSON
[youtube] O9nejN42ZFY: Downloading android player API JSON
[youtube] O9nejN42ZFY: Downloading iframe API JS
[youtube] O9nejN42ZFY: Downloading player 16f9263d
[youtube] O9nejN42ZFY: Downloading web player API JSON
[debug] Loading youtube-nsig.16f9263d from cache
[debug] [youtube] Decrypted nsig dQptxnfmuUPvgsSE- => NSd2tTBIAxPCAg
[youtube] O9nejN42ZFY: Downloading m3u8 information
WARNING: [youtube] unable to extract yt initial data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
WARNING: [youtube] Incomplete data received in embedded initial data; re-fetching using API.
[youtube] O9nejN42ZFY: Downloading initial data API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] O9nejN42ZFY: Downloading 1 format(s): 137+251
ERROR: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1461, in check_filter
    ret = match_filter(info_dict, incomplete=incomplete)
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3752, in _match_func
    if not filters or any(match_str(f, info_dict, incomplete) for f in filters):
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3752, in <genexpr>
    if not filters or any(match_str(f, info_dict, incomplete) for f in filters):
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3732, in match_str
    return all(
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3733, in <genexpr>
    _match_one(filter_part.replace(r'\&', '&'), dct, incomplete)
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3705, in _match_one
    return op(actual_value, comparison_value if numeric_comparison is None else numeric_comparison)
TypeError: '<' not supported between instances of 'int' and 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1560, in wrapper
    return func(self, *args, **kwargs)
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1709, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1768, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 2897, in process_video_result
    self.process_info(new_info)
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 3105, in process_info
    if self._match_entry(info_dict) is not None:
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1488, in _match_entry
    reason = check_filter()
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1464, in check_filter
    ret = None if incomplete else match_filter(info_dict)
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3752, in _match_func
    if not filters or any(match_str(f, info_dict, incomplete) for f in filters):
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3752, in <genexpr>
    if not filters or any(match_str(f, info_dict, incomplete) for f in filters):
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3732, in match_str
    return all(
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3733, in <genexpr>
    _match_one(filter_part.replace(r'\&', '&'), dct, incomplete)
  File "/home/ra/.local/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 3705, in _match_one
    return op(actual_value, comparison_value if numeric_comparison is None else numeric_comparison)
TypeError: '<' not supported between instances of 'int' and 'str'
```