parent
7094366bb5
commit
cf340a1890
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: MangaLife'
|
||||
pkgNameSuffix = 'en.mangalife'
|
||||
extClass = '.MangaLife'
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -11,10 +11,7 @@ import eu.kanade.tachiyomi.network.asObservableSuccess
|
|||
import eu.kanade.tachiyomi.source.model.*
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.Headers
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import okhttp3.*
|
||||
import rx.Observable
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
@ -248,14 +245,19 @@ class MangaLife : HttpSource() {
|
|||
val curChapter = gson.fromJson<JsonElement>(script.substringAfter("vm.CurChapter = ").substringBefore(";"))
|
||||
|
||||
val pageTotal = curChapter["Page"].string.toInt()
|
||||
var chNum = chapterImage(curChapter["Chapter"].string)
|
||||
|
||||
val host = "https://" + script.substringAfter("vm.CurPathName = \"").substringBefore("\"")
|
||||
val titleURI = script.substringAfter("vm.IndexName = \"").substringBefore("\"")
|
||||
val seasonURI = curChapter["Directory"].string
|
||||
.let { if (it.isEmpty()) "" else "$it/" }
|
||||
val path = "$host/manga/$titleURI/$seasonURI"
|
||||
|
||||
var chNum = chapterImage(curChapter["Chapter"].string)
|
||||
val reqJSON = "{\"IndexName\":\"$titleURI\",\"Chapter\":\"$chNum\"}"
|
||||
val request = Request.Builder()
|
||||
.url("$baseUrl/read-online/fetch.php")
|
||||
.post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"),reqJSON))
|
||||
.build()
|
||||
val host = client.newCall(request).execute().body()!!.string().substringAfter("PathName\":\"").substringBefore("\"")
|
||||
val path = "https://$host/manga/$titleURI/$seasonURI"
|
||||
|
||||
return IntRange(1, pageTotal).mapIndexed { i, _ ->
|
||||
var imageNum = (i + 1).toString().let { "000$it" }.let { it.substring(it.length-3) }
|
||||
|
|
Loading…
Reference in New Issue