mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
anime/indo: optimize detail page and domain
This commit is contained in:
parent
c6f89db48a
commit
7dabff1da9
22 changed files with 143 additions and 69 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 13
|
||||
version = 14
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.hexated
|
||||
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.httpsify
|
||||
|
@ -113,8 +115,8 @@ class AnimeIndoProvider : MainAPI() {
|
|||
?.trim() ?: return null
|
||||
val poster = document.selectFirst("div.thumb > img[itemprop=image]")?.attr("src")
|
||||
val tags = document.select("div.genxed > a").map { it.text() }
|
||||
val type = document.selectFirst("div.info-content > div.spe > span:contains(Type:)")?.ownText()
|
||||
?.trim()?.lowercase() ?: "tv"
|
||||
val type = getType(document.selectFirst("div.info-content > div.spe > span:contains(Type:)")?.ownText()
|
||||
?.trim()?.lowercase() ?: "tv")
|
||||
val year = document.selectFirst("div.info-content > div.spe > span:contains(Released:)")?.ownText()?.let {
|
||||
Regex("\\d,\\s(\\d*)").find(it)?.groupValues?.get(1)?.toIntOrNull()
|
||||
}
|
||||
|
@ -126,16 +128,19 @@ class AnimeIndoProvider : MainAPI() {
|
|||
val header = it.selectFirst("span.lchx > a") ?: return@mapNotNull null
|
||||
val episode = header.text().trim().replace("Episode", "").trim().toIntOrNull()
|
||||
val link = fixUrl(header.attr("href"))
|
||||
Episode(link, header.text(), episode = episode)
|
||||
Episode(link, episode = episode)
|
||||
}.reversed()
|
||||
|
||||
val recommendations = document.select("div.relat div.animposx").mapNotNull {
|
||||
it.toSearchResult()
|
||||
}
|
||||
|
||||
return newAnimeLoadResponse(title, url, getType(type)) {
|
||||
val tracker = APIHolder.getTracker(listOf(title),TrackerType.getTypes(type),year,true)
|
||||
|
||||
return newAnimeLoadResponse(title, url, type) {
|
||||
engName = title
|
||||
posterUrl = poster
|
||||
posterUrl = tracker?.image ?: poster
|
||||
backgroundPosterUrl = tracker?.cover
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = status
|
||||
|
@ -143,6 +148,8 @@ class AnimeIndoProvider : MainAPI() {
|
|||
this.tags = tags
|
||||
this.recommendations = recommendations
|
||||
addTrailer(trailer)
|
||||
addMalId(tracker?.malId)
|
||||
addAniListId(tracker?.aniId?.toIntOrNull())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue