FMReader - HanaScan, MangaTR fixes (#2834)

This commit is contained in:
Mike 2020-04-25 21:00:05 -04:00 committed by GitHub
parent 844b32f560
commit 962fb9259a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 21 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: FMReader (multiple aggregators)'
pkgNameSuffix = 'all.fmreader'
extClass = '.FMReaderFactory'
extVersionCode = 8
extVersionCode = 9
libVersion = '1.2'
}

View File

@ -96,6 +96,8 @@ class ReadComicOnlineOrg : FMReader("ReadComicOnline.org", "https://readcomiconl
class HanaScan : FMReader("HanaScan (RawQQ)", "https://hanascan.com", "ja") {
override fun popularMangaNextPageSelector() = "div.col-md-8 button"
// Referer header needs to be chapter URL or not set at all
override fun imageRequest(page: Page): Request = GET(page.imageUrl!!, headersBuilder().removeAll("Referer").build())
}
class RawLH : FMReader("RawLH", "https://loveheaven.net", "ja") {
@ -166,16 +168,12 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
override val chapterTimeSelector = "td[align=right]"
private val chapterListHeaders = headers.newBuilder().add("X-Requested-With", "XMLHttpRequest").build()
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
return if (manga.status != SManga.LICENSED) {
val requestUrl = "$baseUrl/cek/fetch_pages_manga.php?manga_cek=${manga.url.substringAfter("manga-").substringBefore(".")}"
client.newCall(GET(requestUrl, chapterListHeaders))
.asObservableSuccess()
.map { response ->
chapterListParse(response, requestUrl)
}
} else {
Observable.error(Exception("Licensed - No chapters to show"))
}
val requestUrl = "$baseUrl/cek/fetch_pages_manga.php?manga_cek=${manga.url.substringAfter("manga-").substringBefore(".")}"
return client.newCall(GET(requestUrl, chapterListHeaders))
.asObservableSuccess()
.map { response ->
chapterListParse(response, requestUrl)
}
}
private fun chapterListParse(response: Response, requestUrl: String): List<SChapter> {
@ -201,16 +199,6 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
}
override fun pageListRequest(chapter: SChapter): Request = GET("$baseUrl/${chapter.url.substringAfter("cek/")}", headers)
override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>()
document.select("div.chapter-content select:first-of-type option").forEachIndexed { i, imgPage ->
pages.add(Page(i, "$baseUrl/${imgPage.attr("value")}"))
}
return pages.dropLast(1) // last page is a comments page
}
override fun imageUrlParse(document: Document): String = document.select("img.chapter-img").attr("abs:src").trim()
}
class Comicastle : FMReader("Comicastle", "https://www.comicastle.org", "en") {