diff options
author | Remita Amine <[email protected]> | 2020-12-29 19:29:08 +0100 |
---|---|---|
committer | Remita Amine <[email protected]> | 2020-12-29 19:29:08 +0100 |
commit | 9c1e164e0cd77331ea4f0b474b32fd06f84bad71 (patch) | |
tree | ad8ca1433a9cf5184b1f80eb0853139313782aa5 | |
parent | c706fbe9fe4a517ad43ca95393384e5f78870f82 (diff) | |
download | youtube-dl-9c1e164e0cd77331ea4f0b474b32fd06f84bad71.tar.gz youtube-dl-9c1e164e0cd77331ea4f0b474b32fd06f84bad71.zip |
[YoutubeDL] Allow format filtering using audio language(#16209)
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -678,6 +678,7 @@ Also filtering work for comparisons `=` (equals), `^=` (starts with), `$=` (ends - `container`: Name of the container format - `protocol`: The protocol that will be used for the actual download, lower-case (`http`, `https`, `rtsp`, `rtmp`, `rtmpe`, `mms`, `f4m`, `ism`, `http_dash_segments`, `m3u8`, or `m3u8_native`) - `format_id`: A short description of the format + - `language`: Language code Any string comparison may be prefixed with negation `!` in order to produce an opposite comparison, e.g. `!*=` (does not contain). diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 6f477bc32..aaac149e9 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1083,7 +1083,7 @@ class YoutubeDL(object): '*=': lambda attr, value: value in attr, } str_operator_rex = re.compile(r'''(?x) - \s*(?P<key>ext|acodec|vcodec|container|protocol|format_id) + \s*(?P<key>ext|acodec|vcodec|container|protocol|format_id|language) \s*(?P<negation>!\s*)?(?P<op>%s)(?P<none_inclusive>\s*\?)? \s*(?P<value>[a-zA-Z0-9._-]+) \s*$ |