Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Add "local cetk" functionality #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions PyNUSD.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,15 @@ def main(titleid, titlever=None, pack_as_wad=True, decryptcontents=False, localu
print("* Downloading Ticket...")
cetk = nus.ticket
if not cetk:
if pack_as_wad:
print(" Ticket unavailable, can't pack nor verify.")
if os.path.isfile("cetk"):
print(" Ticket unavailable, can't pack. Using local cetk for decryption...")
pack_as_wad = False
with open("cetk", "rb") as f:
cetk = WADGEN.Ticket(f.read())
cetk.dump(os.path.join(titlepath, "cetk"))
else:
print(" Ticket unavailable, can't verify download.")
print(" Ticket unavailable, can't pack nor verify.")
pack_as_wad = False
else:
cetk.dump(os.path.join(titlepath, "cetk"))

Expand Down