diff --git a/src/pt/animesdigital/build.gradle b/src/pt/animesdigital/build.gradle index 9a6f3ef16c..051efdcbd3 100644 --- a/src/pt/animesdigital/build.gradle +++ b/src/pt/animesdigital/build.gradle @@ -8,7 +8,7 @@ ext { extName = 'Animes Digital' pkgNameSuffix = 'pt.animesdigital' extClass = '.AnimesDigital' - extVersionCode = 1 + extVersionCode = 2 libVersion = '13' } diff --git a/src/pt/animesdigital/src/eu/kanade/tachiyomi/animeextension/pt/animesdigital/AnimesDigital.kt b/src/pt/animesdigital/src/eu/kanade/tachiyomi/animeextension/pt/animesdigital/AnimesDigital.kt index 5fa82b0c31..417879f6c8 100644 --- a/src/pt/animesdigital/src/eu/kanade/tachiyomi/animeextension/pt/animesdigital/AnimesDigital.kt +++ b/src/pt/animesdigital/src/eu/kanade/tachiyomi/animeextension/pt/animesdigital/AnimesDigital.kt @@ -57,7 +57,19 @@ class AnimesDigital : ConfigurableAnimeSource, ParsedAnimeHttpSource() { // ============================== Episodes ============================== override fun episodeListParse(response: Response): List { val doc = getRealDoc(response.asJsoup()) - return doc.select(episodeListSelector()).map(::episodeFromElement) + val pagination = doc.selectFirst("ul.content-pagination") + return if (pagination != null) { + val episodes = mutableListOf() + episodes += doc.select(episodeListSelector()).map(::episodeFromElement) + val lastPage = doc.selectFirst("ul.content-pagination > li:nth-last-child(2) > span")!!.text().toInt() + for (i in 2..lastPage) { + val request = GET(doc.location() + "/page/$i", headers) + val res = client.newCall(request).execute() + val pageDoc = res.use { it.asJsoup() } + episodes += pageDoc.select(episodeListSelector()).map(::episodeFromElement) + } + episodes + } else doc.select(episodeListSelector()).map(::episodeFromElement) } override fun episodeFromElement(element: Element) = SEpisode.create().apply {