Files
RecPy2023/RecNet/AvatarItemGen.py
2026-07-26 23:32:39 +00:00

27 lines
552 B
Python

import json
import ProgramUtils
import data
import sys
import requests
name = f"{__name__}.py"
def gen(writeFile: str):
print(f"[{name}] Downloadimg")
sk = requests.request("GET", f"{data.dataUrl}AvatarItems.json")
if sk.status_code != 200:
print(f"ERROR HTTP: {sk.status_code}")
input()
sys.exit()
try:
sk = sk.json()
except:
print(f"ERROR JSON: 0001")
input()
sys.exit()
with open(writeFile, "w") as f:
json.dump(sk, f, indent=2)
print(f"[{name}] Done")