parent
4a41b93fcf
commit
228ec7e024
1 changed files with 4 additions and 3 deletions
|
@ -26,6 +26,7 @@ for mod in glob.glob("pack/mods/*.toml"):
|
||||||
moddata["name"] = data["name"]
|
moddata["name"] = data["name"]
|
||||||
moddata["url"] = ""
|
moddata["url"] = ""
|
||||||
moddata["side"] = data["side"]
|
moddata["side"] = data["side"]
|
||||||
|
license = dict()
|
||||||
|
|
||||||
if "modrinth" in data["update"]:
|
if "modrinth" in data["update"]:
|
||||||
id = data["update"]["modrinth"]["mod-id"]
|
id = data["update"]["modrinth"]["mod-id"]
|
||||||
|
@ -34,12 +35,12 @@ for mod in glob.glob("pack/mods/*.toml"):
|
||||||
moddata["site"] = "Modrinth"
|
moddata["site"] = "Modrinth"
|
||||||
|
|
||||||
if id in cache:
|
if id in cache:
|
||||||
print("Using cached value: " + data["name"])
|
|
||||||
data = cache[id]
|
data = cache[id]
|
||||||
else:
|
else:
|
||||||
print("Not in cache: " + id + " - " + data["name"])
|
|
||||||
data = requests.get("https://api.modrinth.com/v2/project/" + id).json()["license"]
|
data = requests.get("https://api.modrinth.com/v2/project/" + id).json()["license"]
|
||||||
cache[id] = data
|
license["name"] = data["name"]
|
||||||
|
license["url"] = data["url"]
|
||||||
|
cache[id] = license
|
||||||
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"
|
||||||
|
|
Loading…
Reference in a new issue