Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit 296c59e

Browse files
authored
Merge pull request #64 from turtleship69/master
Update api usage for paper to v2
2 parents 50c0717 + 09d2464 commit 296c59e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

MineColab.ipynb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,19 @@
195195
"%cd \"/content/drive/My Drive/Minecraft-server\"\n",
196196
"\n",
197197
"# Internal init...\n",
198+
"\n",
199+
"\n",
200+
"a = requests.get(\"https://papermc.io/api/v2/projects/paper/versions/\" + version)\n",
201+
"#print(a.json()[\"builds\"][-1])\n",
202+
"b = requests.get(\"https://papermc.io/api/v2/projects/paper/versions/\" + version + \"/builds/\" + str(a.json()[\"builds\"][-1]))\n",
203+
"#print(b.json()[\"downloads\"][\"application\"][\"name\"])\n",
204+
"print(\"https://papermc.io/api/v2/projects/paper/versions/\" + version + \"/builds/\" + str(a.json()[\"builds\"][-1]) + \"/downloads/\" + b.json()[\"downloads\"][\"application\"][\"name\"])\n",
205+
"\n",
206+
"paperURL = \"https://papermc.io/api/v2/projects/paper/versions/\" + version + \"/builds/\" + str(a.json()[\"builds\"][-1]) + \"/downloads/\" + b.json()[\"downloads\"][\"application\"][\"name\"]\n",
207+
"\n",
198208
"jar_name = {'paper': 'server.jar', 'fabric': 'fabric-installer.jar'}\n",
199209
"url = {\n",
200-
" 'paper': ('https://papermc.io/api/v1/paper/' + version + '/latest/download'),\n",
210+
" 'paper': (paperURL),\n",
201211
" 'fabric': 'https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.7.4/fabric-installer-0.7.4.jar'\n",
202212
" }\n",
203213
"\n",

0 commit comments

Comments
 (0)