fix(dl): treat audio muxed into the video as an available language

A muxed stream carries its audio in the video track, so -l orig no longer
fails when the only separate audio tracks are dubs.
This commit is contained in:
imSp4rky
2026-08-11 21:24:04 -06:00
parent 9016b526af
commit 356d6fb984
5 changed files with 106 additions and 3 deletions
+2
View File
@@ -523,6 +523,8 @@ class Tracks:
lang_name = video_track.language.display_name()
for video in self.videos:
if video.data.get("audio_language"):
continue
video.needs_repack = True
video.data["audio_language"] = lang_code
video.data["audio_language_name"] = lang_name
+13
View File
@@ -222,6 +222,19 @@ def keep_forced_subtitle(
return match_func(language, forced_s_lang)
def embedded_audio_langs(videos: Sequence[Any], keep_videos: bool) -> list[str]:
"""
Return the audio languages carried inside video tracks rather than beside them.
A muxed stream keeps its audio in the video track, which a service declares by setting
``data["audio_language"]``. That audio is only available while the video is kept, so
dropping the video (``--audio-only``, ``--no-video``) drops the language with it.
"""
if not keep_videos:
return []
return [video.data["audio_language"] for video in videos if video.data.get("audio_language")]
def find_missing_langs(
requested: Sequence[str],
available: Sequence[Union[str, Language, None]],