mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-04-29 22:24:35 +02:00
fix(manager): download link
This commit is contained in:
parent
a63dc8725c
commit
1f8b214d4c
@ -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}" }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user