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