Revert "MangaLife - Fetch Host" (#2046)
Revert "MangaLife - Fetch Host"
This commit is contained in:
parent
cf340a1890
commit
ff8f8f3d76
|
@ -5,7 +5,7 @@ ext {
|
||||||
appName = 'Tachiyomi: MangaLife'
|
appName = 'Tachiyomi: MangaLife'
|
||||||
pkgNameSuffix = 'en.mangalife'
|
pkgNameSuffix = 'en.mangalife'
|
||||||
extClass = '.MangaLife'
|
extClass = '.MangaLife'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,10 @@ import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||||
import eu.kanade.tachiyomi.source.model.*
|
import eu.kanade.tachiyomi.source.model.*
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
import eu.kanade.tachiyomi.util.asJsoup
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
import okhttp3.*
|
import okhttp3.Headers
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Request
|
||||||
|
import okhttp3.Response
|
||||||
import rx.Observable
|
import rx.Observable
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
@ -245,19 +248,14 @@ class MangaLife : HttpSource() {
|
||||||
val curChapter = gson.fromJson<JsonElement>(script.substringAfter("vm.CurChapter = ").substringBefore(";"))
|
val curChapter = gson.fromJson<JsonElement>(script.substringAfter("vm.CurChapter = ").substringBefore(";"))
|
||||||
|
|
||||||
val pageTotal = curChapter["Page"].string.toInt()
|
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 titleURI = script.substringAfter("vm.IndexName = \"").substringBefore("\"")
|
||||||
val seasonURI = curChapter["Directory"].string
|
val seasonURI = curChapter["Directory"].string
|
||||||
.let { if (it.isEmpty()) "" else "$it/" }
|
.let { if (it.isEmpty()) "" else "$it/" }
|
||||||
|
val path = "$host/manga/$titleURI/$seasonURI"
|
||||||
|
|
||||||
val reqJSON = "{\"IndexName\":\"$titleURI\",\"Chapter\":\"$chNum\"}"
|
var chNum = chapterImage(curChapter["Chapter"].string)
|
||||||
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, _ ->
|
return IntRange(1, pageTotal).mapIndexed { i, _ ->
|
||||||
var imageNum = (i + 1).toString().let { "000$it" }.let { it.substring(it.length-3) }
|
var imageNum = (i + 1).toString().let { "000$it" }.let { it.substring(it.length-3) }
|
||||||
|
|
Loading…
Reference in New Issue