Skip to content

Instantly share code, notes, and snippets.

@kalenpw
Created August 12, 2022 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kalenpw/49097da879bf21f736868105a5c8c23b to your computer and use it in GitHub Desktop.
Save kalenpw/49097da879bf21f736868105a5c8c23b to your computer and use it in GitHub Desktop.
Downloads most recent server.jar for Minecraft
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