mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2026-02-17 02:25:39 -05:00
Minor README updates in preparation for WiiPy v1.3.0
This commit is contained in:
27
scripts/content-checker.py
Normal file
27
scripts/content-checker.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
import libWiiPy
|
||||
|
||||
target_hash = sys.argv[1].lower().encode()
|
||||
print(target_hash)
|
||||
|
||||
for content in range(3, 81):
|
||||
try:
|
||||
tmd = libWiiPy.title.download_tmd(f"00000007000000{content:02X}")
|
||||
open(f"00000007000000{content:02X}.tmd", "wb").write(tmd)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
workdir = pathlib.Path(".")
|
||||
|
||||
tmd_files = list(workdir.glob("*.tmd"))
|
||||
|
||||
for tmd in tmd_files:
|
||||
new_tmd = libWiiPy.title.TMD()
|
||||
new_tmd.load(open(tmd, "rb").read())
|
||||
hash_list = []
|
||||
for content in new_tmd.content_records:
|
||||
hash_list.append(content.content_hash)
|
||||
if target_hash in hash_list:
|
||||
print(f"Found match in {tmd}\n")
|
||||
28
scripts/nus-scraper.py
Normal file
28
scripts/nus-scraper.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
|
||||
import libWiiPy
|
||||
|
||||
tid_high = ["00010000", "00010001", "00010005"]
|
||||
types = ["43", "44", "45", "46", "47", "48", "4A", "4C", "4D", "4E", "50", "51", "52", "53", "57", "58"]
|
||||
regions = ["45", "4A", "4B", "50"]
|
||||
|
||||
|
||||
for tid in tid_high:
|
||||
print(f"Starting scrape for TID high {tid}...")
|
||||
|
||||
if os.path.exists(f"{tid}.log"):
|
||||
os.remove(f"{tid}.log")
|
||||
log = open(f"{tid}.log", "a")
|
||||
|
||||
for ttype in types:
|
||||
print(f"Scraping titles of type: {ttype}")
|
||||
for title in range(0, 65536):
|
||||
for region in regions:
|
||||
try:
|
||||
tmd = libWiiPy.title.download_tmd(f"{tid}{ttype}{title:04X}{region}")
|
||||
print(f"Found valid TID: {tid}{ttype}{title:04X}{region}")
|
||||
log.write(f"{tid}{ttype}{title:02X}{region}")
|
||||
except ValueError:
|
||||
print(f"Invalid TID: {tid}{ttype}{title:04X}{region}")
|
||||
pass
|
||||
log.close()
|
||||
Reference in New Issue
Block a user