fix megatokyo image selector & chapter order (#9024)

* fix megatokyo image selector

* Update build.gradle

* also fix the reversed chapter order

* whoops
This commit is contained in:
az4521 2021-09-10 12:21:36 -04:00 committed by GitHub
parent 2a3d88cea0
commit 27a785e15e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Megatokyo'
pkgNameSuffix = 'en.megatokyo'
extClass = '.Megatokyo'
extVersionCode = 1
extVersionCode = 2
}
apply from: "$rootDir/common.gradle"

View File

@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
@ -49,6 +50,10 @@ class Megatokyo : ParsedHttpSource() {
override fun fetchMangaDetails(manga: SManga): Observable<SManga> = fetchPopularManga(1)
.map { it.mangas.first().apply { initialized = true } }
override fun chapterListParse(response: Response): List<SChapter> {
return super.chapterListParse(response).reversed()
}
override fun chapterListSelector() =
"div.content h2:contains(Comics by Date) + div ul li a[name]"
@ -62,7 +67,7 @@ class Megatokyo : ParsedHttpSource() {
}
override fun pageListParse(document: Document) =
document.select("#strip-bl a img")
document.select("#strip img")
.mapIndexed { i, element ->
Page(i, "", "https://megatokyo.com/" + element.attr("src"))
}