FMReader - HanaScan, MangaTR fixes (#2834)
This commit is contained in:
parent
844b32f560
commit
962fb9259a
|
@ -5,7 +5,7 @@ ext {
|
||||||
appName = 'Tachiyomi: FMReader (multiple aggregators)'
|
appName = 'Tachiyomi: FMReader (multiple aggregators)'
|
||||||
pkgNameSuffix = 'all.fmreader'
|
pkgNameSuffix = 'all.fmreader'
|
||||||
extClass = '.FMReaderFactory'
|
extClass = '.FMReaderFactory'
|
||||||
extVersionCode = 8
|
extVersionCode = 9
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,8 @@ class ReadComicOnlineOrg : FMReader("ReadComicOnline.org", "https://readcomiconl
|
||||||
|
|
||||||
class HanaScan : FMReader("HanaScan (RawQQ)", "https://hanascan.com", "ja") {
|
class HanaScan : FMReader("HanaScan (RawQQ)", "https://hanascan.com", "ja") {
|
||||||
override fun popularMangaNextPageSelector() = "div.col-md-8 button"
|
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") {
|
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]"
|
override val chapterTimeSelector = "td[align=right]"
|
||||||
private val chapterListHeaders = headers.newBuilder().add("X-Requested-With", "XMLHttpRequest").build()
|
private val chapterListHeaders = headers.newBuilder().add("X-Requested-With", "XMLHttpRequest").build()
|
||||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
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(".")}"
|
val requestUrl = "$baseUrl/cek/fetch_pages_manga.php?manga_cek=${manga.url.substringAfter("manga-").substringBefore(".")}"
|
||||||
client.newCall(GET(requestUrl, chapterListHeaders))
|
return client.newCall(GET(requestUrl, chapterListHeaders))
|
||||||
.asObservableSuccess()
|
.asObservableSuccess()
|
||||||
.map { response ->
|
.map { response ->
|
||||||
chapterListParse(response, requestUrl)
|
chapterListParse(response, requestUrl)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Observable.error(Exception("Licensed - No chapters to show"))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun chapterListParse(response: Response, requestUrl: String): List<SChapter> {
|
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 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") {
|
class Comicastle : FMReader("Comicastle", "https://www.comicastle.org", "en") {
|
||||||
|
|
Loading…
Reference in New Issue