From 31e81432e34d70f74438038358c6b95c5aaafd3c Mon Sep 17 00:00:00 2001 From: Sihht Date: Thu, 17 Apr 2025 10:51:20 -0500 Subject: [PATCH 1/3] audio codec fix --- vinetrimmer/commands/dl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vinetrimmer/commands/dl.py b/vinetrimmer/commands/dl.py index 7947ad3..2a10317 100644 --- a/vinetrimmer/commands/dl.py +++ b/vinetrimmer/commands/dl.py @@ -309,7 +309,7 @@ def dl(ctx, profile, cdm, *_, **__): @dl.result_callback() @click.pass_context -def result(ctx, service, quality, closest_resolution, range_, wanted, alang, slang, audio_only, subs_only, chapters_only, audio_description, +def result(ctx, service, quality, closest_resolution, range_, wanted, alang, slang, codec, audio_only, subs_only, chapters_only, audio_description, list_, keys, cache, no_cache, no_subs, no_audio, no_video, no_chapters, atmos, vbitrate: int, abitrate: int, no_mux, mux, selected, latest_episode, strip_sdh, *_, **__): def ccextractor(): log.info("Extracting EIA-608 captions from stream with CCExtractor") @@ -410,7 +410,7 @@ def result(ctx, service, quality, closest_resolution, range_, wanted, alang, sla quality = closest_res title.tracks.select_videos(by_quality=quality, by_vbitrate=vbitrate, by_range=range_, one_only=True) - title.tracks.select_audios(by_language=alang, by_bitrate=abitrate, with_descriptive=audio_description) + title.tracks.select_audios(by_language=alang, by_bitrate=abitrate, with_descriptive=audio_description, by_codec=acodec) title.tracks.select_subtitles(by_language=slang, with_forced=True) vbitrate = "min" From 16f267052dd17d469d27e95c05dbd47382e05652 Mon Sep 17 00:00:00 2001 From: Sihht Date: Thu, 17 Apr 2025 10:54:12 -0500 Subject: [PATCH 2/3] fix audio codec --- vinetrimmer/objects/tracks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vinetrimmer/objects/tracks.py b/vinetrimmer/objects/tracks.py index c475d3e..bc4d96a 100644 --- a/vinetrimmer/objects/tracks.py +++ b/vinetrimmer/objects/tracks.py @@ -892,6 +892,7 @@ class MenuTrack: class Tracks: + AUDIO_CODEC_MAP = {"EC3": "ec-3", "AAC": "mp4a"} """ Tracks. Stores video, audio, and subtitle tracks. It also stores chapter/menu entries. @@ -1190,7 +1191,7 @@ class Tracks: if not with_descriptive: self.audios = [x for x in self.audios if not x.descriptive] if by_codec: - codec_audio = list(filter(lambda x: any(y for y in self.AUDIO_CODEC_MAP[by_codec] if y in x.codec), self.audio)) + codec_audio = list(filter(lambda x: any(y for y in self.AUDIO_CODEC_MAP[by_codec] if y in x.codec), self.audios)) if not codec_audio and not should_fallback: raise ValueError(f"There's no {by_codec} audio tracks. Aborting.") else: From 98db15454c0f2c7b8be62f734b8bfdcdfad1d1e3 Mon Sep 17 00:00:00 2001 From: Sihht Date: Thu, 17 Apr 2025 11:30:55 -0500 Subject: [PATCH 3/3] Update dl.py --- vinetrimmer/commands/dl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vinetrimmer/commands/dl.py b/vinetrimmer/commands/dl.py index 2a10317..44c5749 100644 --- a/vinetrimmer/commands/dl.py +++ b/vinetrimmer/commands/dl.py @@ -309,7 +309,7 @@ def dl(ctx, profile, cdm, *_, **__): @dl.result_callback() @click.pass_context -def result(ctx, service, quality, closest_resolution, range_, wanted, alang, slang, codec, audio_only, subs_only, chapters_only, audio_description, +def result(ctx, service, quality, closest_resolution, range_, wanted, alang, slang, acodec, audio_only, subs_only, chapters_only, audio_description, list_, keys, cache, no_cache, no_subs, no_audio, no_video, no_chapters, atmos, vbitrate: int, abitrate: int, no_mux, mux, selected, latest_episode, strip_sdh, *_, **__): def ccextractor(): log.info("Extracting EIA-608 captions from stream with CCExtractor")