diff --git a/README.md b/README.md index 8c8ed9b..fb88fa5 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ Usage: vt.cmd AMZN [OPTIONS] [TITLE] 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. 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 diff --git a/vinetrimmer/commands/dl.py b/vinetrimmer/commands/dl.py index 8332fb6..dbfa404 100644 --- a/vinetrimmer/commands/dl.py +++ b/vinetrimmer/commands/dl.py @@ -211,6 +211,8 @@ def get_credentials(service, profile="default"): help="Video Color Range, defaults to SDR.") @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.") +@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", help="Language wanted for audio.") @click.option("-sl", "--slang", callback=language_param, default="all", @@ -305,7 +307,7 @@ def dl(ctx, profile, cdm, *_, **__): @dl.result_callback() @click.pass_context 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(): log.info("Extracting EIA-608 captions from stream with CCExtractor") 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.print() + if latest_episode: + titles = Titles(as_list(titles[-1])) + for title in titles.with_wanted(wanted): if title.type == Title.Types.TV: log.info("Getting tracks for {title} S{season:02}E{episode:02}{name} [{id}]".format( diff --git a/vinetrimmer/key_store.db b/vinetrimmer/key_store.db index e02d63c..f454e12 100644 Binary files a/vinetrimmer/key_store.db and b/vinetrimmer/key_store.db differ diff --git a/vinetrimmer/services/max.py b/vinetrimmer/services/max.py index fbbf392..9ca1df6 100644 --- a/vinetrimmer/services/max.py +++ b/vinetrimmer/services/max.py @@ -122,8 +122,7 @@ class Max(BaseService): seasons = [int(season["value"]) for season in season_data["options"]] - season_parameters = [(int(season["value"]), season["parameter"]) for season in season_data["options"] - for season_number in seasons if int(season["id"]) == int(season_number)] + 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)] if not season_parameters: raise self.log.exit("season(s) %s not found")