Upload files to "RecNet"
This commit is contained in:
27
RecNet/AvatarItemGen.py
Normal file
27
RecNet/AvatarItemGen.py
Normal file
@@ -0,0 +1,27 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user