You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
458 B
16 lines
458 B
import requests
|
|
|
|
version = "1.18.1"
|
|
destPath = "../server/paper.jar"
|
|
|
|
base = "https://papermc.io/api/v2/projects/paper/versions"
|
|
r = requests.get(f"{base}/{version}")
|
|
|
|
build = max(r.json()['builds'])
|
|
r = requests.get(f"{base}/{version}/builds/{build}")
|
|
|
|
download = r.json()['downloads']['application']['name']
|
|
content = requests.get(f"{base}/{version}/builds/{build}/downloads/{download}").content
|
|
|
|
with open(destPath, "wb") as file:
|
|
file.write(content)
|
|
|