Merge branch 'dev' of https://github.com/chu23465/VT-PR into dev
This commit is contained in:
commit
280c280d6d
@ -320,7 +320,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, acodec, audio_only, subs_only, chapters_only, audio_description,
|
||||
list_, keys, cache, no_cache, no_subs, no_audio, no_video, no_chapters, atmos, vbitrate, abitrate: int, no_mux, mux, selected, latest_episode, strip_sdh, *_, **__):
|
||||
def ccextractor():
|
||||
log.info("Extracting EIA-608 captions from stream with CCExtractor")
|
||||
@ -420,7 +420,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)
|
||||
except ValueError as e:
|
||||
log.error(f" - {e}")
|
||||
|
||||
@ -903,6 +903,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.
|
||||
@ -1201,7 +1202,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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user