diff --git a/src/ar/teamx/build.gradle b/src/ar/teamx/build.gradle index 24b4a94bc..7cfd34356 100644 --- a/src/ar/teamx/build.gradle +++ b/src/ar/teamx/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Team X' pkgNameSuffix = 'ar.teamx' extClass = '.TeamX' - extVersionCode = 8 + extVersionCode = 9 libVersion = '1.2' } diff --git a/src/ar/teamx/src/eu/kanade/tachiyomi/extension/ar/teamx/TeamX.kt b/src/ar/teamx/src/eu/kanade/tachiyomi/extension/ar/teamx/TeamX.kt index 8523c593b..17b6d0e54 100644 --- a/src/ar/teamx/src/eu/kanade/tachiyomi/extension/ar/teamx/TeamX.kt +++ b/src/ar/teamx/src/eu/kanade/tachiyomi/extension/ar/teamx/TeamX.kt @@ -117,6 +117,29 @@ class TeamX : ParsedHttpSource() { } // Chapters + private fun chapterNextPageSelector() = "span.nextx_text a:contains(ยป)" + + override fun chapterListParse(response: Response): List { + val allChapters = mutableListOf() + var document = response.asJsoup() + + while (true) { + val pageChapters = document.select(chapterListSelector()).map { chapterFromElement(it) } + if (pageChapters.isEmpty()) + break + + allChapters += pageChapters + + val hasNextPage = document.select(chapterNextPageSelector()).isNotEmpty() + if (!hasNextPage) + break + + val nextUrl = document.select(chapterNextPageSelector()).attr("href") + document = client.newCall(GET(nextUrl, headers)).execute().asJsoup() + } + + return allChapters + } // Filter out the fake chapters override fun chapterListSelector() = "div.single-manga-chapter div.col-md-12 a[href^=$baseUrl]"