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["url"] = ""
|
||||
moddata["side"] = data["side"]
|
||||
license = dict()
|
||||
|
||||
if "modrinth" in data["update"]:
|
||||
id = data["update"]["modrinth"]["mod-id"]
|
||||
|
@ -34,12 +35,12 @@ for mod in glob.glob("pack/mods/*.toml"):
|
|||
moddata["site"] = "Modrinth"
|
||||
|
||||
if id in cache:
|
||||
print("Using cached value: " + data["name"])
|
||||
data = cache[id]
|
||||
else:
|
||||
print("Not in cache: " + id + " - " + data["name"])
|
||||
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"]:
|
||||
moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"])
|
||||
moddata["site"] = "CurseForge"
|
||||
|
|
Loading…
Reference in a new issue