Created
August 12, 2022 04:31
-
-
Save kalenpw/49097da879bf21f736868105a5c8c23b to your computer and use it in GitHub Desktop.
Downloads most recent server.jar for Minecraft
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
import urllib.request, json | |
with urllib.request.urlopen("https://launchermeta.mojang.com/mc/game/version_manifest.json") as manifest_url: | |
manifest_data = json.loads(manifest_url.read().decode()) | |
current_url = manifest_data['versions'][0]['url'] | |
with urllib.request.urlopen(current_url) as current_url: | |
current_data = json.loads(current_url.read().decode()) | |
jar_url = current_data['downloads']['server']['url'] | |
urllib.request.urlretrieve(jar_url, "server.jar") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment