diff --git a/src/en/mangalife/build.gradle b/src/en/mangalife/build.gradle index 0d43e2710..c5d8a6425 100644 --- a/src/en/mangalife/build.gradle +++ b/src/en/mangalife/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: MangaLife' pkgNameSuffix = 'en.mangalife' extClass = '.MangaLife' - extVersionCode = 2 + extVersionCode = 3 libVersion = '1.2' } diff --git a/src/en/mangalife/src/eu/kanade/tachiyomi/extension/en/mangalife/mangalife.kt b/src/en/mangalife/src/eu/kanade/tachiyomi/extension/en/mangalife/mangalife.kt index 569f83326..678dfd352 100644 --- a/src/en/mangalife/src/eu/kanade/tachiyomi/extension/en/mangalife/mangalife.kt +++ b/src/en/mangalife/src/eu/kanade/tachiyomi/extension/en/mangalife/mangalife.kt @@ -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(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) }