mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2026-02-17 02:25:39 -05:00
Added simple NUS downloading interface
This commit is contained in:
22
modules/nus.py
Normal file
22
modules/nus.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# "nus.py" from libWiiPy-cli by NinjaCheetah
|
||||
# https://github.com/NinjaCheetah/libWiiPy-cli
|
||||
|
||||
import libWiiPy
|
||||
|
||||
|
||||
def download_title(title_id: str, title_version_input: str = None):
|
||||
title_version = None
|
||||
if title_version_input is not None:
|
||||
try:
|
||||
title_version = int(title_version_input)
|
||||
except ValueError:
|
||||
print("Enter a valid integer for the Title Version.")
|
||||
return
|
||||
|
||||
title = libWiiPy.download_title(title_id, title_version)
|
||||
|
||||
file_name = title_id + "-v" + str(title.tmd.title_version) + ".wad"
|
||||
|
||||
wad_file = open(file_name, "wb")
|
||||
wad_file.write(title.dump_wad())
|
||||
wad_file.close()
|
||||
Reference in New Issue
Block a user