From 1670e29c254384c677048b9bc0229b29580efa4a Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Fri, 3 Mar 2023 19:18:25 +0100 Subject: [PATCH] tab instead of spaces --- scripts/get_paper.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/scripts/get_paper.py b/scripts/get_paper.py index 62356ad..f52788e 100755 --- a/scripts/get_paper.py +++ b/scripts/get_paper.py @@ -5,35 +5,35 @@ import sys def get_paper(version, destination): - print(f"Trying to fetch {version} into {destination}") + print(f"Trying to fetch {version} into {destination}") - base = "https://papermc.io/api/v2/projects/paper/versions" - r = requests.get(f"{base}/{version}") - if not r.ok: - print(f"Cannot find version {version}, aborting.") - return + base = "https://papermc.io/api/v2/projects/paper/versions" + r = requests.get(f"{base}/{version}") + if not r.ok: + print(f"Cannot find version {version}, aborting.") + return - build = max(r.json()['builds']) - r = requests.get(f"{base}/{version}/builds/{build}") + 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 + download = r.json()['downloads']['application']['name'] + content = requests.get(f"{base}/{version}/builds/{build}/downloads/{download}").content - with open(destination, "wb") as jarFile: - jarFile.write(content) + with open(destination, "wb") as jarFile: + jarFile.write(content) def main(argv): - if len(argv) == 1: - print("No version defined!") - return - version = argv[1] - if len(argv) == 2: - destination = "paper.jar" - else: - destination = argv[2] - get_paper(version, destination) + if len(argv) == 1: + print("No version defined!") + return + version = argv[1] + if len(argv) == 2: + destination = "paper.jar" + else: + destination = argv[2] + get_paper(version, destination) if __name__ == "__main__": - main(sys.argv) + main(sys.argv)