diff --git a/images.py b/images.py new file mode 100644 index 0000000..6ff04e4 --- /dev/null +++ b/images.py @@ -0,0 +1,46 @@ +import json, requests, os + +os.mkdir("skins") + +with open("skins.json", "r") as f: + content = json.load(f) + +for skin in content: + url = skin["image"] + weapon = skin["weapon"]["id"] + paint_index = skin["paint_index"] + + if "sfui_wpnhud" in weapon: + continue + + content = requests.get(url).content + + with open(f"skins/{weapon}_{paint_index}.png", "wb") as f: + f.write(content) + +with open("base_weapons.json", "r") as f: + content = json.load(f) + +for skin in content: + url = skin["image"] + weapon = skin["id"].replace("base_weapon-", "") + + if "sfui_wpnhud" in weapon: + continue + + content = requests.get(url).content + + with open(f"skins/{weapon}_0.png", "wb") as f: + f.write(content) + +with open("agents.json", "r") as f: + content = json.load(f) + +for skin in content: + url = skin["image"] + weapon = skin["id"] + + content = requests.get(url).content + + with open(f"skins/{weapon}_0.png", "wb") as f: + f.write(content) \ No newline at end of file