[YoutubeDL] Allow format filtering using audio language(#16209)
authorRemita Amine <remitamine@gmail.com>
Tue, 29 Dec 2020 18:29:08 +0000 (19:29 +0100)
committerRemita Amine <remitamine@gmail.com>
Tue, 29 Dec 2020 18:29:08 +0000 (19:29 +0100)
README.md
youtube_dl/YoutubeDL.py

index ffa34493e1bd6fbaed608bc26a4c653d4b7c7781..85fed6d3ad7514c4af44f45497aaa4153fc65559 100644 (file)
--- a/README.md
+++ b/README.md
@@ -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).
 
index 6f477bc3205952b32b4c4bf6f7622589740d0fb9..aaac149e9bb5f3c43b5b56140d9c812b5f45d0a4 100755 (executable)
@@ -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*$