Throw missing version warning before downloading content in nus module

This commit is contained in:
Campbell 2024-10-30 14:11:28 -04:00
parent 4941cf8b94
commit b77587771c
Signed by: NinjaCheetah
GPG Key ID: 670C282B3291D63D

View File

@ -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))