mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-03-12 01:19:02 +00:00
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
This commit is contained in:
@@ -237,6 +237,7 @@ class dl:
|
|||||||
@click.option("-ns", "--no-subs", is_flag=True, default=False, help="Do not download subtitle tracks.")
|
@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("-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("-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(
|
@click.option(
|
||||||
"--slow",
|
"--slow",
|
||||||
is_flag=True,
|
is_flag=True,
|
||||||
@@ -582,6 +583,7 @@ class dl:
|
|||||||
no_subs: bool,
|
no_subs: bool,
|
||||||
no_audio: bool,
|
no_audio: bool,
|
||||||
no_chapters: bool,
|
no_chapters: bool,
|
||||||
|
audio_description: bool,
|
||||||
slow: bool,
|
slow: bool,
|
||||||
list_: bool,
|
list_: bool,
|
||||||
list_titles: bool,
|
list_titles: bool,
|
||||||
@@ -1065,6 +1067,7 @@ class dl:
|
|||||||
# filter audio tracks
|
# filter audio tracks
|
||||||
# might have no audio tracks if part of the video, e.g. transport stream hls
|
# might have no audio tracks if part of the video, e.g. transport stream hls
|
||||||
if len(title.tracks.audio) > 0:
|
if len(title.tracks.audio) > 0:
|
||||||
|
if not audio_description:
|
||||||
title.tracks.select_audio(lambda x: not x.descriptive) # exclude descriptive audio
|
title.tracks.select_audio(lambda x: not x.descriptive) # exclude descriptive audio
|
||||||
if acodec:
|
if acodec:
|
||||||
title.tracks.select_audio(lambda x: x.codec == acodec)
|
title.tracks.select_audio(lambda x: x.codec == acodec)
|
||||||
|
|||||||
Reference in New Issue
Block a user