From ec3e15084613eded8272f06819db6f03789d1c22 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 24 Oct 2025 00:53:47 +0000 Subject: [PATCH] feat(dl): add --audio-description flag to download AD tracks Add support for downloading audio description tracks via the --audio-description/-ad flag. Previously, descriptive audio tracks were always filtered out. Users can now optionally include them. Fixes #33 --- unshackle/commands/dl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unshackle/commands/dl.py b/unshackle/commands/dl.py index 9821674..43e5cd7 100644 --- a/unshackle/commands/dl.py +++ b/unshackle/commands/dl.py @@ -237,6 +237,7 @@ class dl: @click.option("-ns", "--no-subs", is_flag=True, default=False, help="Do not download subtitle tracks.") @click.option("-na", "--no-audio", is_flag=True, default=False, help="Do not download audio tracks.") @click.option("-nc", "--no-chapters", is_flag=True, default=False, help="Do not download chapters tracks.") + @click.option("-ad", "--audio-description", is_flag=True, default=False, help="Download audio description tracks.") @click.option( "--slow", is_flag=True, @@ -582,6 +583,7 @@ class dl: no_subs: bool, no_audio: bool, no_chapters: bool, + audio_description: bool, slow: bool, list_: bool, list_titles: bool, @@ -1065,7 +1067,8 @@ class dl: # filter audio tracks # might have no audio tracks if part of the video, e.g. transport stream hls if len(title.tracks.audio) > 0: - title.tracks.select_audio(lambda x: not x.descriptive) # exclude descriptive audio + if not audio_description: + title.tracks.select_audio(lambda x: not x.descriptive) # exclude descriptive audio if acodec: title.tracks.select_audio(lambda x: x.codec == acodec) if not title.tracks.audio: