mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-26 19:05:13 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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]],
|
||||
|
||||
Reference in New Issue
Block a user