test
Some checks failed
Update wiki / test (push) Failing after 18s

This commit is contained in:
Ashley Graves 2024-08-01 01:27:21 +02:00
parent c12f3fe13d
commit 1e6f11eaf3

View file

@ -13,8 +13,9 @@ count["client"] = 0
count["both"] = 0
cache = dict()
with open("licenses.json") as f:
cache = json.load(f)
with open("licenses.json") as f:
cache = json.load(f)
for mod in glob.glob("pack/mods/*.toml"):
with open(mod, "r") as f:
@ -31,11 +32,10 @@ for mod in glob.glob("pack/mods/*.toml"):
moddata["site"] = "Modrinth"
if moddata["name"] in cache:
data = cache[moddata["name"]]
data = cache[id]
else:
data = requests.get("https://api.modrinth.com/v2/project/" + id).json()["license"]
with open("licenses.json") as f:
f.write(json.dumps(data))
cache[id] = data
elif "curseforge" in data["update"]:
moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"])
moddata["site"] = "CurseForge"
@ -43,7 +43,6 @@ for mod in glob.glob("pack/mods/*.toml"):
count[moddata["side"]] += 1
mods[moddata["name"]] = moddata
with open("wiki/Modlist.md", "w") as f:
f.write("## Total Count\r\n")
f.write("<table>")
@ -107,3 +106,6 @@ with open("wiki/Licenses.md", "w") as f:
else:
f.write("Unknown")
f.write("</b>\r\n")
with open("licenses.json") as f:
json.dump(cache, f)