Kumanga - fix token (#4077)
This commit is contained in:
parent
7865e6a42e
commit
90308cf7b2
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'Kumanga'
|
extName = 'Kumanga'
|
||||||
pkgNameSuffix = 'es.kumanga'
|
pkgNameSuffix = 'es.kumanga'
|
||||||
extClass = '.Kumanga'
|
extClass = '.Kumanga'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,13 @@ class Kumanga : HttpSource() {
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
private var kumangaToken = ""
|
private var kumangaToken = ""
|
||||||
|
private val tokenRegex = Regex(""""([^"\s]{100,})"""")
|
||||||
|
|
||||||
private fun getKumangaToken() {
|
private fun getKumangaToken() {
|
||||||
kumangaToken = client.newCall(GET("$baseUrl/mangalist?&page=1", headers)).execute().asJsoup()
|
kumangaToken = client.newCall(GET("$baseUrl/mangalist?&page=1", headers)).execute().asJsoup()
|
||||||
.select("div.input-group [type=hidden]").firstOrNull()?.outerHtml()?.substringBeforeLast("\"")?.substringAfterLast("\"")
|
.select("div.input-group [type=hidden]")
|
||||||
|
.firstOrNull()
|
||||||
|
?.let { tokenRegex.find(it.outerHtml())?.groupValues?.get(1) }
|
||||||
?: throw IOException("No fue posible obtener la lista de mangas")
|
?: throw IOException("No fue posible obtener la lista de mangas")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue