MyReadingManga: Fix covers and missing chapters (#7715)
* fix covers and missing chapters * clean spaces
This commit is contained in:
parent
1585a295a3
commit
2a707c1072
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'MyReadingManga'
|
extName = 'MyReadingManga'
|
||||||
extClass = '.MyReadingMangaFactory'
|
extClass = '.MyReadingMangaFactory'
|
||||||
extVersionCode = 56
|
extVersionCode = 57
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
|
||||||
private fun getImage(element: Element): String? {
|
private fun getImage(element: Element): String? {
|
||||||
val url = when {
|
val url = when {
|
||||||
element.attr("data-src").contains(extensionRegex) -> element.attr("abs:data-src")
|
element.attr("data-src").contains(extensionRegex) -> element.attr("abs:data-src")
|
||||||
|
element.attr("data-cfsrc").contains(extensionRegex) -> element.attr("abs:data-cfsrc")
|
||||||
element.attr("src").contains(extensionRegex) -> element.attr("abs:src")
|
element.attr("src").contains(extensionRegex) -> element.attr("abs:src")
|
||||||
else -> element.attr("abs:data-lazy-src")
|
else -> element.attr("abs:data-lazy-src")
|
||||||
}
|
}
|
||||||
|
@ -184,7 +185,7 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
|
||||||
override fun mangaDetailsParse(document: Document) = throw UnsupportedOperationException()
|
override fun mangaDetailsParse(document: Document) = throw UnsupportedOperationException()
|
||||||
|
|
||||||
// Start Chapter Get
|
// Start Chapter Get
|
||||||
override fun chapterListSelector() = ".entry-pagination a"
|
override fun chapterListSelector() = "a[class=page-numbers]"
|
||||||
|
|
||||||
@SuppressLint("DefaultLocale")
|
@SuppressLint("DefaultLocale")
|
||||||
override fun chapterListParse(response: Response): List<SChapter> {
|
override fun chapterListParse(response: Response): List<SChapter> {
|
||||||
|
@ -198,14 +199,13 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
|
||||||
// create first chapter since its on main manga page
|
// create first chapter since its on main manga page
|
||||||
chapters.add(createChapter("1", document.baseUri(), date, chfirstname))
|
chapters.add(createChapter("1", document.baseUri(), date, chfirstname))
|
||||||
// see if there are multiple chapters or not
|
// see if there are multiple chapters or not
|
||||||
document.select(chapterListSelector()).let { it ->
|
val lastChapterNumber = document.select(chapterListSelector()).last()?.text()
|
||||||
it.forEach {
|
if (lastChapterNumber != null) {
|
||||||
if (!it.text().contains("Next »", true)) {
|
// There are entries with more chapters but those never show up,
|
||||||
val pageNumber = it.text()
|
// so we take the last one and loop it to get all hidden ones.
|
||||||
val chname = document.select(".chapter-class a[href$=/$pageNumber/]").text().ifEmpty { "Ch. $pageNumber" }?.replaceFirstChar { it.titlecase() }
|
// Example: 1 2 3 4 .. 7 8 9 Next
|
||||||
?: "Ch. $pageNumber"
|
for (i in 2..lastChapterNumber.toInt()) {
|
||||||
chapters.add(createChapter(it.text(), document.baseUri(), date, chname))
|
chapters.add(createChapter(i.toString(), document.baseUri(), date, "Ch. $i"))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chapters.reverse()
|
chapters.reverse()
|
||||||
|
|
Loading…
Reference in New Issue