Added a `--latest-episode` flag. Updated README to include correct ASIN display script. Fixed MAX seasons length.
This commit is contained in:
Aswin 2025-04-07 19:31:40 +05:30
parent 09e03b47f7
commit 73d53c3efe
4 changed files with 8 additions and 4 deletions

View File

@ -178,7 +178,7 @@ Usage: vt.cmd AMZN [OPTIONS] [TITLE]
Region is chosen automatically based on domain extension found in cookies. Region is chosen automatically based on domain extension found in cookies.
Prime Video specific code will be run if the ASIN is detected to be a prime video variant. Prime Video specific code will be run if the ASIN is detected to be a prime video variant.
Use 'Amazon Video ASIN Display' for Tampermonkey addon for ASIN Use 'Amazon Video ASIN Display' for Tampermonkey addon for ASIN
https://greasyfork.org/en/scripts/381997-amazon-video-asin-display https://greasyfork.org/en/scripts/496577-amazon-video-asin-display
vt dl --list -z uk -q 1080 Amazon B09SLGYLK8 vt dl --list -z uk -q 1080 Amazon B09SLGYLK8

View File

@ -211,6 +211,8 @@ def get_credentials(service, profile="default"):
help="Video Color Range, defaults to SDR.") help="Video Color Range, defaults to SDR.")
@click.option("-w", "--wanted", callback=wanted_param, default=None, @click.option("-w", "--wanted", callback=wanted_param, default=None,
help="Wanted episodes, e.g. `S01-S05,S07`, `S01E01-S02E03`, `S02-S02E03`, e.t.c, defaults to all.") help="Wanted episodes, e.g. `S01-S05,S07`, `S01E01-S02E03`, `S02-S02E03`, e.t.c, defaults to all.")
@click.option("-le", "--latest-episode", is_flag=True, default=False,
help="Download the latest episode on episodes list.")
@click.option("-al", "--alang", callback=language_param, default="orig", @click.option("-al", "--alang", callback=language_param, default="orig",
help="Language wanted for audio.") help="Language wanted for audio.")
@click.option("-sl", "--slang", callback=language_param, default="all", @click.option("-sl", "--slang", callback=language_param, default="all",
@ -305,7 +307,7 @@ def dl(ctx, profile, cdm, *_, **__):
@dl.result_callback() @dl.result_callback()
@click.pass_context @click.pass_context
def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs_only, chapters_only, audio_description, def result(ctx, service, quality, range_, wanted, alang, slang, 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, *_, **__): list_, keys, cache, no_cache, no_subs, no_audio, no_video, no_chapters, atmos, vbitrate: int, abitrate: int, no_mux, mux, selected, latest_episode, *_, **__):
def ccextractor(): def ccextractor():
log.info("Extracting EIA-608 captions from stream with CCExtractor") log.info("Extracting EIA-608 captions from stream with CCExtractor")
track_id = f"ccextractor-{track.id}" track_id = f"ccextractor-{track.id}"
@ -342,6 +344,9 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
titles.order() titles.order()
titles.print() titles.print()
if latest_episode:
titles = Titles(as_list(titles[-1]))
for title in titles.with_wanted(wanted): for title in titles.with_wanted(wanted):
if title.type == Title.Types.TV: if title.type == Title.Types.TV:
log.info("Getting tracks for {title} S{season:02}E{episode:02}{name} [{id}]".format( log.info("Getting tracks for {title} S{season:02}E{episode:02}{name} [{id}]".format(

Binary file not shown.

View File

@ -122,8 +122,7 @@ class Max(BaseService):
seasons = [int(season["value"]) for season in season_data["options"]] seasons = [int(season["value"]) for season in season_data["options"]]
season_parameters = [(int(season["value"]), season["parameter"]) for season in season_data["options"] season_parameters = [(int(season["id"]), season["parameter"]) for season in season_data["options"]] #[(int(season["value"]), season["parameter"]) for season in season_data["options"] for season_number in seasons if int(season["id"]) == int(season_number)]
for season_number in seasons if int(season["id"]) == int(season_number)]
if not season_parameters: if not season_parameters:
raise self.log.exit("season(s) %s not found") raise self.log.exit("season(s) %s not found")