parent
c12f3fe13d
commit
1e6f11eaf3
1 changed files with 8 additions and 6 deletions
|
@ -13,6 +13,7 @@ count["client"] = 0
|
|||
count["both"] = 0
|
||||
|
||||
cache = dict()
|
||||
|
||||
with open("licenses.json") as f:
|
||||
cache = json.load(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)
|
||||
|
|
Loading…
Reference in a new issue