-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a script to automatically update mods * Update mods: - Xaero's Minimap: 23.8.0 -> 23.8.4 - Xaero's World Map: 1.34.1 -> 1.35.0 - censoredASM: 5.16 -> 5.17 - Mixinbooter: 8.4 -> 8.6 - CEu: 2.7.3 -> 2.7.4 - AE2 UEL: 0.55.23b -> 0.55.24 * always add all ae2 recipes, and add a tooltip instead * Update mods: - GregTech CE Unofficial 2.7.4-beta -> 2.8.1-beta - GroovyScript 0.6.4 -> 0.7.0 - VisualOres 0.2.2 -> 0.2.4 - Had Enough Items 4.25.0 -> 4.25.1 - Xaero's Minimap 23.8.3 -> 23.9.0 - Xaero's World Map 1.35.0 -> 1.37.0 - CensoredASM 5.17 -> 5.18 - MixinBooter 8.6 -> 8.9 - LittleTiles v1.5.82 -> v1.5.84 - AE2 Unofficial Extended Life v0.55.24 -> v0.55.27 - AE2 Fluid Crafting Rework 2.4.31-r -> 2.4.33-r - Sledgehammer 2.0.23 -> 2.0.25 * downgrade Xaero's mods due to instability - Xaero's Minimap 23.9.0 -> 23.8.4 - Xaero's World Map 1.37.0 -> 1.36.0 * move gt cfg to new location * revert ae2 script changes * mod updates xaero's minimap -> v23.9.1 xaero's worldmap -> v1.37.1 mixinbooter -> v8.8 littletiles -> v1.5.85 gtceu -> v2.8.3 sledgehammer -> v2.0.25 groovyscript -> v0.7.1 removes MTLib --------- Co-authored-by: TechLord22 <[email protected]>
- Loading branch information
1 parent
b460b04
commit 6ff73fb
Showing
4 changed files
with
175 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import os | ||
import json | ||
import requests | ||
from datetime import datetime | ||
|
||
def is112(file): | ||
True in ["1.12" in i for i in file["gameVersions"]] | ||
|
||
headers = { | ||
"Accept": "application/json", | ||
"x-api-key": os.getenv("CFAPIKEY") | ||
} | ||
|
||
basePath = os.path.normpath(os.path.realpath(__file__)[:-13] + "..") | ||
with open(f"{basePath}/manifest.json") as f: | ||
manifest = json.load(f) | ||
|
||
ver_id = requests.get("https://api.curseforge.com/v1/minecraft/version/1.12.2", headers = headers).json()["data"]["gameVersionTypeId"] | ||
|
||
for entry in manifest["files"]: | ||
project_id = entry["projectID"] | ||
mod = requests.get(f"https://api.curseforge.com/v1/mods/{project_id}", headers = headers).json()["data"] | ||
|
||
old_file = requests.get(f"https://api.curseforge.com/v1/mods/{project_id}/files/" + str(entry["fileID"]), headers = headers).json()["data"] | ||
|
||
latest_files = requests.get(f"https://api.curseforge.com/v1/mods/{project_id}/files?gameVersionTypeId={ver_id}", headers = headers).json()["data"] | ||
new_file = sorted(latest_files, key=lambda file: datetime.fromisoformat(file["fileDate"])) | ||
|
||
new_file = new_file[-1] | ||
|
||
if datetime.fromisoformat(new_file["fileDate"]) > datetime.fromisoformat(old_file["fileDate"]): | ||
if input(mod["name"] + " (" + old_file["fileName"] + ") -> " + new_file["fileName"] + "?") == "y": | ||
entry["fileID"] = new_file["id"] | ||
|
||
|
||
with open(f"{basePath}/manifest.json", "w") as f: | ||
json.dump(manifest, f, indent=4) |
Oops, something went wrong.