Skip to content

Commit

Permalink
not usable yet but push it first
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTeaMC committed Aug 26, 2024
1 parent 1d9a89c commit 90d062e
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/softwares.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,26 @@ pub fn get_other(software: String, version: String) -> Result<(), Box<dyn std::e
.max();

if let Some(latest_build) = latest_build {
let jar_name = format!("{}-{}-{}.jar", software, version, latest_build);
if software == "purpur" {
let purpur_download_url = format!(
"https://api.purpurmc.org/v2/purpur/{}/latest/download",
version
);
let res = client
.get(format!(
"https://api.papermc.io/v2/projects/{}/versions/{}/builds/{}/downloads/{}",
software, version, latest_build, jar_name
"https://api.purpurmc.org/v2/purpur/{}/latest/download",
version
))
.send();
} else {
let jar_name = format!("{}-{}-{}.jar", software, version, latest_build);
let res = client
.get(format!(
"https://api.papermc.io/v2/projects/{}/versions/{}/builds/{}/downloads/{}",
software, version, latest_build, jar_name
))
.send();
}
if let Ok(res) = res {
download_jar(res)?;
Ok(())
Expand Down

0 comments on commit 90d062e

Please sign in to comment.