53 lines
1.1 KiB
Python
53 lines
1.1 KiB
Python
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"]
|
|
url_big = skin["big_image"]
|
|
weapon = skin["id"]
|
|
|
|
content = requests.get(url).content
|
|
|
|
with open(f"skins/{weapon}_0.png", "wb") as f:
|
|
f.write(content)
|
|
|
|
content_big = requests.get(url_big).content
|
|
|
|
with open(f"skins/{weapon}_big.png", "wb") as f:
|
|
f.write(content_big)
|