Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.apache.http.client.methods.HttpGet
import org.apache.http.impl.client.HttpClientBuilder
import java.io.File
import java.io.IOException
import java.net.URLEncoder

object CurseModJarDownloader {
fun download(
Expand Down Expand Up @@ -32,7 +33,9 @@ object CurseModJarDownloader {

println("file name is: ${file.displayName}, id: ${file.id}")

val downloadUrl = ForgeSvcApi.getFileInfo(client, project.id, file.id).downloadUrl
val downloadUrl = "https://edge.forgecdn.net/files/" +
"${file.id}".chunked(4).joinToString("/") + "/" +
URLEncoder.encode(file.displayName, "UTF-8")

val request = HttpGet(downloadUrl)
client.execute(request).use { response ->
Expand Down