mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
Animasu: fix poster
This commit is contained in:
parent
0db99c3205
commit
4aa062b89f
7 changed files with 31 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 8
|
||||
version = 9
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -79,7 +79,7 @@ class Animasu : MainAPI() {
|
|||
private fun Element.toSearchResult(): AnimeSearchResponse {
|
||||
val href = getProperAnimeLink(fixUrlNull(this.selectFirst("a")?.attr("href")).toString())
|
||||
val title = this.select("div.tt").text().trim()
|
||||
val posterUrl = fixUrlNull(this.selectFirst("img")?.attr("src"))
|
||||
val posterUrl = fixUrlNull(this.selectFirst("img")?.getImageAttr())
|
||||
val epNum = this.selectFirst("span.epx")?.text()?.filter { it.isDigit() }?.toIntOrNull()
|
||||
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||
this.posterUrl = posterUrl
|
||||
|
@ -98,7 +98,7 @@ class Animasu : MainAPI() {
|
|||
val document = app.get(url).document
|
||||
|
||||
val title = document.selectFirst("div.infox h1")?.text().toString().replace("Sub Indo", "").trim()
|
||||
val poster = document.selectFirst("div.bigcontent img")?.attr("src")?.replace("\n", "")
|
||||
val poster = document.selectFirst("div.bigcontent img")?.getImageAttr()
|
||||
|
||||
val table = document.selectFirst("div.infox div.spe")
|
||||
val type = getType(table?.selectFirst("span:contains(Jenis:)")?.ownText())
|
||||
|
@ -179,4 +179,13 @@ class Animasu : MainAPI() {
|
|||
?: Qualities.Unknown.value
|
||||
}
|
||||
|
||||
private fun Element.getImageAttr(): String? {
|
||||
return when {
|
||||
this.hasAttr("data-src") -> this.attr("abs:data-src")
|
||||
this.hasAttr("data-lazy-src") -> this.attr("abs:data-lazy-src")
|
||||
this.hasAttr("srcset") -> this.attr("abs:srcset").substringBefore(" ")
|
||||
else -> this.attr("abs:src")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -12,5 +12,6 @@ class AnimasuPlugin: Plugin() {
|
|||
registerMainAPI(Animasu())
|
||||
registerExtractorAPI(Archivd())
|
||||
registerExtractorAPI(Newuservideo())
|
||||
registerExtractorAPI(Vidhidepro())
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.hexated
|
|||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.SubtitleFile
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.extractors.Filesim
|
||||
import com.lagradost.cloudstream3.utils.AppUtils
|
||||
import com.lagradost.cloudstream3.utils.ExtractorApi
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
|
@ -99,4 +100,9 @@ class Newuservideo : ExtractorApi() {
|
|||
@JsonProperty("streams") val streams: ArrayList<Streams>? = null,
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
class Vidhidepro : Filesim() {
|
||||
override val mainUrl = "https://vidhidepro.com"
|
||||
override val name = "Vidhidepro"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue