forked from kenzuya/unshackle
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user