mirror of
https://github.com/Radiquum/YAMPD.git
synced 2025-05-20 15:49:34 +05:00
feat: add dependencies resolution for CurseForge
This commit is contained in:
parent
c517795725
commit
ee133e9111
1 changed files with 7 additions and 0 deletions
|
@ -77,6 +77,13 @@ def getCurseForgeMod(slug, version, mod_loader, game_version):
|
||||||
hashes[HASHALGO_ENUM[hash.get("algo")]] = hash.get("value")
|
hashes[HASHALGO_ENUM[hash.get("algo")]] = hash.get("value")
|
||||||
|
|
||||||
dependencies = []
|
dependencies = []
|
||||||
|
for dep in selected_version.get("dependencies"):
|
||||||
|
depDescR = requests.get(f"https://api.curseforge.com/v1/mods/{dep.get('modId')}/", headers=headers)
|
||||||
|
if depDescR.status_code != 200:
|
||||||
|
continue
|
||||||
|
depDesc: dict = depDescR.json()
|
||||||
|
depMod = getCurseForgeMod(depDesc.get("data").get("slug"), None, mod_loader, game_version)
|
||||||
|
dependencies.append(depMod.get("mod"))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"status": "ok",
|
"status": "ok",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue