Skip to content

Commit

Permalink
fix: new bds download url
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Dec 14, 2024
1 parent 83c8177 commit af9a56f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const (
)

var VERSION_TEMPLATE = map[string]*template.Template{
"windows": template.Must(template.New("windows").Parse("https://minecraft.azureedge.net/bin-win/bedrock-server-{{.}}.zip")),
"linux": template.Must(template.New("linux").Parse("https://minecraft.azureedge.net/bin-linux/bedrock-server-{{.}}.zip")),
"windows-preview": template.Must(template.New("windows-preview").Parse("https://minecraft.azureedge.net/bin-win-preview/bedrock-server-{{.}}.zip")),
"linux-preview": template.Must(template.New("linux-preview").Parse("https://minecraft.azureedge.net/bin-linux-preview/bedrock-server-{{.}}.zip")),
"windows": template.Must(template.New("windows").Parse("https://www.minecraft.net/bedrockdedicatedserver/bin-win/bedrock-server-{{.}}.zip")),
"linux": template.Must(template.New("linux").Parse("https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-{{.}}.zip")),
"windows-preview": template.Must(template.New("windows-preview").Parse("https://www.minecraft.net/bedrockdedicatedserver/bin-win-preview/bedrock-server-{{.}}.zip")),
"linux-preview": template.Must(template.New("linux-preview").Parse("https://www.minecraft.net/bedrockdedicatedserver/bin-linux-preview/bedrock-server-{{.}}.zip")),
}

func main() {
Expand Down Expand Up @@ -58,10 +58,10 @@ func main() {
}
err := DownloadFile(u.String(), f)
if err != nil {
if u.Host != "minecraft.azureedge.net" {
if u.Host != "www.minecraft.net" {
log.Errorf("failed to download from mirror: %v, trying fallback", err)
u.Scheme = "https"
u.Host = "minecraft.azureedge.net"
u.Host = "www.minecraft.net"
err := DownloadFile(u.String(), f)
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit af9a56f

Please sign in to comment.