Working version. Using latest of everything.

This commit is contained in:
2025-06-17 20:00:40 +02:00
parent 1fb4bd9e85
commit 44f2ae9e62
2 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,5 @@
# minecraft_server_downloader # minecraft_server_downloader
Grab the latest minecraft server.jar binary (to hand off to other tools) Grab the latest minecraft server.jar binary.
Uses Python3 and the Requests library.

26
fetcher.py Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env python3
import requests
# Fetch some manifests
url="https://launchermeta.mojang.com/mc/game/version_manifest.json"
stage1 = requests.get(url)
latest = stage1.json()["latest"]["release"]
print("Latest version of Minecraft (Release):",latest)
# Iterate through the json, grab the manifest of the newest version
for version in stage1.json()["versions"]:
if latest == version["id"]:
# print(version)
url = version["url"]
# Grab it. Print.
stage2 = requests.get(url)
print("Downloading:",stage2.json()["downloads"]["server"]["url"])
print("Grabbing server.jar")
jarfile = requests.get(stage2.json()["downloads"]["server"]["url"])
open("server.jar", "wb").write(jarfile.content)
print("Done!")