parent
09a5ac4181
commit
e101af805f
1 changed files with 9 additions and 2 deletions
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue