From b77587771cf84dbb90191ba40e34955708947de4 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:11:28 -0400 Subject: [PATCH] Throw missing version warning before downloading content in nus module --- modules/title/nus.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/title/nus.py b/modules/title/nus.py index e125af0..8f598c8 100644 --- a/modules/title/nus.py +++ b/modules/title/nus.py @@ -146,6 +146,11 @@ def handle_nus_content(args): else: output_path = pathlib.Path(args.output) + # Ensure that a version was supplied before downloading, because we need the matching TMD for decryption to work. + if decrypt_content is True and version is None: + print("You must specify the version that the requested content belongs to for decryption!") + return + # Try to download the content, and catch the ValueError libWiiPy will throw if it can't be found. print("Downloading content with Content ID " + cid + "...") try: @@ -154,11 +159,6 @@ def handle_nus_content(args): raise ValueError("The Title ID or Content ID you specified could not be found!") if decrypt_content is True: - # Ensure that a version was supplied, because we need the matching TMD for decryption to work. - if version is None: - print("You must specify the version that the requested content belongs to for decryption!") - return - output_path = output_path.with_suffix(".app") tmd = libWiiPy.title.TMD() tmd.load(libWiiPy.title.download_tmd(tid, version))