diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index 425292f..af1008f 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -168,8 +168,9 @@ class DASH: track_type = Subtitle track_codec = Subtitle.Codec.from_codecs(codecs or "vtt") track_args = dict( - forced=self.is_forced(adaptation_set), - cc=self.is_closed_caption(adaptation_set) + cc=self.is_closed_caption(adaptation_set), + sdh=self.is_sdh(adaptation_set), + forced=self.is_forced(adaptation_set) ) elif content_type == "image": # we don't want what's likely thumbnails for the seekbar @@ -638,6 +639,14 @@ class DASH: for x in adaptation_set.findall("Role") ) + @staticmethod + def is_sdh(adaptation_set: Element) -> bool: + """Check if contents of Adaptation Set is for the Hearing Impaired.""" + return any( + (x.get("schemeIdUri"), x.get("value")) == ("urn:tva:metadata:cs:AudioPurposeCS:2007", "2") + for x in adaptation_set.findall("Accessibility") + ) + @staticmethod def is_closed_caption(adaptation_set: Element) -> bool: """Check if contents of Adaptation Set is a Closed Caption Subtitle."""