FMReader - add Epik Manga (#2895)

FMReader - add Epik Manga
This commit is contained in:
Mike 2020-04-28 08:22:29 -04:00 committed by GitHub
parent c0991ef873
commit 31c0888972
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 3 deletions

View File

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

View File

@ -37,7 +37,7 @@ abstract class FMReader(
add("Referer", baseUrl)
}
private fun Elements.imgAttr(): String? = getImgAttr(this.firstOrNull())
protected fun Elements.imgAttr(): String? = getImgAttr(this.firstOrNull())
private fun Element.imgAttr(): String? = getImgAttr(this)

View File

@ -40,7 +40,8 @@ class FMReaderFactory : SourceFactory {
Manhwa18Net(),
Manhwa18NetRaw(),
MangaBorn(),
SayTruyen()
SayTruyen(),
EpikManga()
)
}
@ -324,3 +325,43 @@ class SayTruyen : FMReader("Say Truyen", "https://saytruyen.com", "vi") {
}
override fun pageListParse(document: Document): List<Page> = super.pageListParse(document).onEach { it.imageUrl!!.trim() }
}
class EpikManga : FMReader("Epik Manga", "https://www.epikmanga.com", "tr") {
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/seri-listesi?sorting=views&sorting-type=DESC&Sayfa=$page", headers)
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/seri-listesi?sorting=lastUpdate&sorting-type=DESC&Sayfa=$page", headers)
override fun popularMangaNextPageSelector() = "ul.pagination li.active + li:not(.disabled)"
// search wasn't working on source's website
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
return client.newCall(searchMangaRequest(page, query, filters))
.asObservableSuccess()
.map { response ->
searchMangaParse(response, query)
}
}
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = GET("$baseUrl/seri-listesi?type=text", headers)
private fun searchMangaParse(response: Response, query: String): MangasPage {
val mangas = response.asJsoup().select("div.char.col-lg-4 a")
.filter { it.text().contains(query, ignoreCase = true) }
.map {
SManga.create().apply {
setUrlWithoutDomain(it.attr("href"))
title = it.text()
}
}
return MangasPage(mangas, false)
}
override fun mangaDetailsParse(document: Document): SManga {
val infoElement = document.select("div.col-md-9 div.row").first()
return SManga.create().apply {
status = parseStatus(infoElement.select("h4:contains(Durum:)").firstOrNull()?.ownText())
author = infoElement.select("h4:contains(Yazar:)").firstOrNull()?.ownText()
artist = infoElement.select("h4:contains(Çizer:)").firstOrNull()?.ownText()
genre = infoElement.select("h4:contains(Türler:) a").joinToString { it.text() }
thumbnail_url = infoElement.select("img.thumbnail").imgAttr()
description = document.select("div.col-md-12 p").text()
}
}
override fun chapterListSelector() = "table.table tbody tr"
override fun getFilterList(): FilterList = FilterList()
}