bastimeyer · GitHub

@bastimeyer

Parse the language of `EXT-X-MEDIA` tags and parse the languages
of the user's `hls-audio-select` values.
Compare both plain language codes and the parsed languages when
selecting the audio streams, so users are able to select audio streams
1. without having to know the specific ISO 639-2 language codes:
   Languages are looked up by the `alpha_2`, `alpha_3`, `name`
   and `bibliographic` attributes on the HLS playlist and user input.
   This means that for example `--hls-audio-select=German` will match
   German audio streams with `LANGUAGE="deu"`.
2. with language codes that are invalid or reserved for private use:
   Valid language codes are not guaranteed, so plain string comparisons
   are still needed, just like before. `pycountry` also rejects codes
   reserved for private use, so we need to handle this case as well.

Read the original on github.com ↗