mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2025-04-26 13:21:01 -04:00
Rewrote scraping script around requests instead of downloading the whole TMD every time
This commit is contained in:
parent
02fa6d09ac
commit
c51244e8e7
@ -1,6 +1,7 @@
|
||||
import os
|
||||
|
||||
import libWiiPy
|
||||
import requests
|
||||
|
||||
|
||||
tid_high = ["00010000", "00010001", "00010005"]
|
||||
types = ["43", "44", "45", "46", "47", "48", "4A", "4C", "4D", "4E", "50", "51", "52", "53", "57", "58"]
|
||||
@ -18,11 +19,12 @@ for tid in tid_high:
|
||||
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}")
|
||||
request = requests.get(url=f"http://ccs.cdn.wup.shop.nintendo.net/ccs/download/{tid}{ttype}{title:04X}{region}/tmd", headers={'User-Agent': 'wii libnup/1.0'}, stream=True)
|
||||
if request.status_code == 200:
|
||||
print(f"Found valid TID: {tid}{ttype}{title:04X}{region}")
|
||||
log.write(f"{tid}{ttype}{title:02X}{region}")
|
||||
except ValueError:
|
||||
else:
|
||||
print(f"Invalid TID: {tid}{ttype}{title:04X}{region}")
|
||||
pass
|
||||
request.close()
|
||||
log.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user