mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2025-04-26 13:21:01 -04:00
This does change a large amount of the syntax for using the CLI, but I think that's for the better. This new system also allows for having help pages for each sub command, making the tool a lot easier to use. It also allows for having more arguments available for each subcommand, which is especially necessary for the ASH module.
25 lines
652 B
Python
25 lines
652 B
Python
# "nus.py" from WiiPy by NinjaCheetah
|
|
# https://github.com/NinjaCheetah/WiiPy
|
|
|
|
import libWiiPy
|
|
|
|
|
|
def handle_nus(args):
|
|
title_version = None
|
|
if args.version is not None:
|
|
try:
|
|
title_version = int(args.version)
|
|
except ValueError:
|
|
print("Enter a valid integer for the Title Version.")
|
|
return
|
|
|
|
title = libWiiPy.title.download_title(args.tid, title_version)
|
|
|
|
file_name = args.tid + "-v" + str(title.tmd.title_version) + ".wad"
|
|
|
|
wad_file = open(file_name, "wb")
|
|
wad_file.write(title.dump_wad())
|
|
wad_file.close()
|
|
|
|
print("Downloaded title with Title ID \"" + args.tid + "\"!")
|