Skip to content

Commit

Permalink
Fix domain and page recient (#119)
Browse files Browse the repository at this point in the history
* Fix domain and page recient

* change popular and lasted

* minus
  • Loading branch information
Yush0DAN authored Oct 23, 2024
1 parent e531f19 commit 67e75e2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/es/hentaila/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'HentaiLA'
extClass = '.Hentaila'
extVersionCode = 29
extVersionCode = 30
isNsfw = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {

override val name = "Hentaila"

override val baseUrl = "https://www4.hentaila.com"
override val baseUrl = "https://www5.hentaila.com"

override val lang = "es"

Expand Down Expand Up @@ -73,25 +73,35 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
}
}

override fun popularAnimeRequest(page: Int) = GET("$baseUrl/directorio?filter=popular&p=$page", headers)
override fun popularAnimeRequest(page: Int) = GET(baseUrl, headers)

override fun popularAnimeParse(response: Response): AnimesPage {
val document = response.asJsoup()
val elements = document.select(".hentais .hentai")
val nextPage = document.select(".pagination .fa-arrow-right").any()
val animeList = elements.map { element ->
val elements = document.select("section.latest-hentais div.slider > div.item")
val animes = elements.map { element ->
SAnime.create().apply {
setUrlWithoutDomain(element.select("a").attr("abs:href"))
title = element.selectFirst(".h-header .h-title")!!.text()
thumbnail_url = element.selectFirst(".h-thumb img")!!.attr("abs:src").replace("/fondos/", "/portadas/")
setUrlWithoutDomain(element.select("h2.h-title a").attr("abs:href"))
title = element.selectFirst("h2.h-title a")!!.text()
thumbnail_url = element.selectFirst("figure.bg img")!!.attr("abs:src").replace("/fondos/", "/portadas/")
}
}
return AnimesPage(animeList, nextPage)
return AnimesPage(animes, false)
}

override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/directorio?filter=recent&p=$page", headers)
override fun latestUpdatesRequest(page: Int) = GET(baseUrl, headers)

override fun latestUpdatesParse(response: Response) = popularAnimeParse(response)
override fun latestUpdatesParse(response: Response): AnimesPage {
val document = response.asJsoup()
val elements = document.select("section.episodes div.grid article.hentai")
val animes = elements.map { element ->
SAnime.create().apply {
setUrlWithoutDomain(element.select("a").attr("abs:href").replace("/ver/", "/hentai-").substringBeforeLast("-"))
title = element.selectFirst("h2.h-title")!!.text()
thumbnail_url = element.selectFirst("img")!!.attr("abs:src").replace("/thumbs/", "/portadas/")
}
}
return AnimesPage(animes.distinctBy { it.url }, false)
}

override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
val filterList = if (filters.isEmpty()) getFilterList() else filters
Expand Down

0 comments on commit 67e75e2

Please sign in to comment.