fix(manager): download link

This commit is contained in:
rhunk 2024-09-05 14:14:41 +02:00
parent a63dc8725c
commit 1f8b214d4c

View File

@ -52,11 +52,8 @@ class APKMirror {
).execute().use { response2 -> ).execute().use { response2 ->
if (!response2.isSuccessful) return null if (!response2.isSuccessful) return null
val document = Jsoup.parse(response2.body.string()) val document = Jsoup.parse(response2.body.string())
val downloadForm = document.getElementById("filedownload") ?: return null val downloadLink = document.getElementById("download-link")?.attr("href") ?: return null
val arguments = downloadForm.childNodes().mapNotNull { return BASE_URL + downloadLink
(it.attr("name") to it.attr("value")).takeIf { pair -> pair.second.isNotEmpty() }
}
return BASE_URL + downloadForm.attr("action") + "?" + arguments.joinToString("&") { "${it.first}=${it.second}" }
} }
} }
} }