Manga Pro cover and chapter list bugs fixed (#12111)
* Fixed #11881 and #11809 * Updated override code * Code Reformatting
This commit is contained in:
parent
c0b0be97ec
commit
52ff0a4b8d
|
@ -2,7 +2,12 @@ package eu.kanade.tachiyomi.extension.ar.mangaproz
|
|||
|
||||
import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class MangaPro : WPMangaStream("Manga Pro", "https://mangaprotm.com", "ar") {
|
||||
|
@ -13,4 +18,36 @@ class MangaPro : WPMangaStream("Manga Pro", "https://mangaprotm.com", "ar") {
|
|||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.rateLimit(4)
|
||||
.build()
|
||||
|
||||
override fun chapterListParse(response: Response): List<SChapter> =
|
||||
super.chapterListParse(response).filter { !it.url.isNullOrEmpty() }
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter {
|
||||
val urlElement = element.select(".lchx > a, span.leftoff a, div.eph-num > a").first()
|
||||
val chapter = SChapter.create()
|
||||
|
||||
// ignore chapters that are protected behind ads shortners.
|
||||
if (urlElement.attr("href").startsWith(baseUrl))
|
||||
chapter.setUrlWithoutDomain(urlElement.attr("href"))
|
||||
else
|
||||
chapter.setUrlWithoutDomain("")
|
||||
|
||||
chapter.name = if (urlElement.select("span.chapternum")
|
||||
.isNotEmpty()) urlElement.select("span.chapternum").text() else urlElement.text()
|
||||
chapter.name = chapter.name.replace("-*free".toRegex(RegexOption.IGNORE_CASE), "")
|
||||
chapter.date_upload =
|
||||
element.select("span.rightoff, time, span.chapterdate").firstOrNull()?.text()
|
||||
?.let { parseChapterDate(it) }
|
||||
?: 0
|
||||
return chapter
|
||||
}
|
||||
|
||||
override fun mangaDetailsParse(document: Document): SManga =
|
||||
super.mangaDetailsParse(document).apply {
|
||||
document.select("div.bigcontent, div.animefull, div.main-info").firstOrNull()
|
||||
?.let { infoElement ->
|
||||
thumbnail_url =
|
||||
infoElement.select(mangaDetailsSelectorThumbnail).attr("abs:data-lazy-src")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
|
|||
SingleLang("Komik Station", "https://komikstation.co", "id", overrideVersionCode = 3),
|
||||
SingleLang("KomikIndo.co", "https://komikindo.co", "id", className = "KomikindoCo", overrideVersionCode = 3),
|
||||
SingleLang("Kuma Scans (Kuma Translation)", "https://kumascans.com", "en", className = "KumaScans", overrideVersionCode = 1),
|
||||
SingleLang("Manga Pro", "https://mangaprotm.com", "ar", pkgName = "mangaproz", overrideVersionCode = 2),
|
||||
SingleLang("Manga Pro", "https://mangaprotm.com", "ar", pkgName = "mangaproz", overrideVersionCode = 3),
|
||||
SingleLang("Manga Raw.org", "https://mangaraw.org", "ja", className = "MangaRawOrg", overrideVersionCode = 1),
|
||||
SingleLang("Manhwax", "https://manhwax.com", "en", isNsfw = true),
|
||||
SingleLang("MangaSwat", "https://swatmanga.co", "ar", overrideVersionCode = 6),
|
||||
|
|
Loading…
Reference in New Issue