2 releases
0.0.2 | Oct 26, 2021 |
---|---|
0.0.1 | Oct 26, 2021 |
#936 in Games
9KB
145 lines
MCDL
Automatically download minecraft server jars in one line (or one click)
Installation
- Download (Windows, Linux)
- Install via cargo:
cargo install mcdl
Examples
mcdl
- download latest server asserver.jar
mcdl -s
- download latest snapshot jarmcdl -sp
- print latest snapshot versionmcdl -n
- download latest server asserver-1.17.1.jar
mcdl -n 1.16.5
- download 1.16.5 asserver-1.16.5.jar
Usage
USAGE:
mcdl.exe [FLAGS] [OPTIONS] [--] [VERSION]...
FLAGS:
-h, --help Prints help information
-i, --insecure Don't check the sha1 for the file
-l, --latest Use latest version, snapshot or not
-n, --named Use the version as the file name
-p, --print Print the version instead of downloading it
-q, --quiet Don't print any unnecessary output
-s, --snapshot Use the latest snapshot
-V, --version Prints version information
OPTIONS:
-r, --rename <rename>... Provide a file name (.jar) is appended
ARGS:
<VERSION>... Get a specific version
Why?
I thought it would be fun to write in Rust. If you wanted a single line of bash to do it, use one of these (requires jq
, curl
, and wget
):
-
Download latest available (snapshot or release) minecraft server.jar
curl -s $(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r ".versions[0].url") | jq -r ".downloads.server.url" | xargs wget
-
Download latest release minecraft server.jar
curl -s $(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r ".latest.release as \$v | .versions[] | select(.id == \$v) | .url") | jq -r ".downloads.server.url" | xargs wget
-
Download latest snapshot minecraft server.jar
curl -s $(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r ".latest.snapshot as \$v | .versions[] | select(.id == \$v) | .url") | jq -r ".downloads.server.url" | xargs wget
Dependencies
~5–6.5MB
~116K SLoC