Skip to content

Commit

Permalink
fix: anime-sama latest page
Browse files Browse the repository at this point in the history
  • Loading branch information
hollowshiroyuki committed Jun 9, 2024
1 parent 8c40d6b commit aac490d
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import eu.kanade.tachiyomi.util.asJsoup
import eu.kanade.tachiyomi.util.parallelCatchingFlatMap
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Request
import okhttp3.Response
import uy.kohesive.injekt.Injekt
Expand Down Expand Up @@ -64,9 +65,13 @@ class AnimeSama : ConfigurableAnimeSource, AnimeHttpSource() {
// =============================== Latest ===============================
override fun latestUpdatesParse(response: Response): AnimesPage {
val animes = response.asJsoup()
val seasons = animes.select("h2:contains(derniers ajouts) + .scrollBarStyled > div").flatMap {
val animeUrl = it.getElementsByTag("a").attr("href")
fetchAnimeSeasons(animeUrl)
val seasons = animes.select("#containerAjoutsAnimes > div").flatMap {
val animeUrl = it.getElementsByTag("a").attr("href").toHttpUrl()
val url = animeUrl.newBuilder()
.removePathSegment(animeUrl.pathSize - 2)
.removePathSegment(animeUrl.pathSize - 3)
.build()
fetchAnimeSeasons(url.toString())
}
return AnimesPage(seasons, false)
}
Expand Down

0 comments on commit aac490d

Please sign in to comment.