Agents image download

This commit is contained in:
2026-09-03 02:36:35 +02:00
parent e7f30ecea4
commit aab93dad02

46
images.py Normal file
View File

@@ -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)