From f4363ae57ef88c892670cb655d50833e6cb03b42 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 11 Feb 2023 17:12:22 +0000 Subject: [PATCH] Fix HLS conversion of JOC Audio Tracks channels --- devine/core/manifests/hls.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devine/core/manifests/hls.py b/devine/core/manifests/hls.py index c755fde..52af20f 100644 --- a/devine/core/manifests/hls.py +++ b/devine/core/manifests/hls.py @@ -164,9 +164,13 @@ class HLS: else: drm = None + joc = 0 if media.type == "AUDIO": track_type = Audio codec = audio_codecs_by_group_id.get(media.group_id) + if media.channels.endswith("/JOC"): + joc = int(media.channels.split("/JOC")[0]) + media.channels = "5.1" else: track_type = Subtitle codec = Subtitle.Codec.WebVTT # assuming WebVTT, codec info isn't shown @@ -184,6 +188,7 @@ class HLS: **(dict( bitrate=0, # TODO: M3U doesn't seem to state bitrate? channels=media.channels, + joc=joc, descriptive="public.accessibility.describes-video" in (media.characteristics or ""), ) if track_type is Audio else dict( forced=media.forced == "YES",