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

This commit is contained in:
Ashley Graves 2024-08-01 01:12:46 +02:00
parent 09a5ac4181
commit e101af805f

View file

@ -1,5 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
#from pip._vendor import requests
import requests
from pip._vendor import tomli from pip._vendor import tomli
import glob import glob
import os import os
@ -20,9 +22,14 @@ for mod in glob.glob("pack/mods/*.toml"):
moddata["url"] = "" moddata["url"] = ""
if "modrinth" in data["update"]: if "modrinth" in data["update"]:
moddata["url"] = "https://modrinth.com/mod/" + data["update"]["modrinth"]["mod-id"] id = data["update"]["modrinth"]["mod-id"]
moddata["id"] = id
moddata["url"] = "https://modrinth.com/mod/" + id
moddata["site"] = "Modrinth" moddata["site"] = "Modrinth"
moddata["license"] = ""
data = json.loads(requests.get("https://api.modrinth.com/v2/project/" + id))
print(data)
return
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"