fix(n_m3u8dl_re): read lang attribute from DASH manifests correctly

The track_selection function was using findall() to search for lang child elements, but in DASH manifests lang is an XML attribute on AdaptationSet. This caused language selection to fail for region-specific codes like es-419.
This commit is contained in:
Andy
2025-11-08 06:04:37 +00:00
parent 11bcca9632
commit 90e4030a88

View File

@@ -57,7 +57,11 @@ def track_selection(track: object) -> list[str]:
if track_type == "Audio":
codecs = AUDIO_CODEC_MAP.get(codec)
langs = adaptation_set.findall("lang") + representation.findall("lang")
langs = []
if adaptation_set.get("lang"):
langs.append(adaptation_set.get("lang"))
if representation is not None and representation.get("lang"):
langs.append(representation.get("lang"))
track_ids = list(
set(
v