mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Some fixes on Italian providers (#29)
This commit is contained in:
parent
b368fcce02
commit
a535ba088d
25 changed files with 542 additions and 32 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
version = 2
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addDuration
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addRating
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.Qualities
|
||||
import org.jsoup.nodes.Element
|
||||
|
@ -14,6 +16,7 @@ class AnimeSaturnProvider : MainAPI() {
|
|||
override var name = "AnimeSaturn"
|
||||
override var lang = "it"
|
||||
override val hasMainPage = true
|
||||
override val hasQuickSearch = true
|
||||
|
||||
override val supportedTypes = setOf(
|
||||
TvType.Anime,
|
||||
|
@ -21,6 +24,12 @@ class AnimeSaturnProvider : MainAPI() {
|
|||
TvType.OVA
|
||||
)
|
||||
|
||||
private data class QuickSearchParse(
|
||||
@JsonProperty("link") val link: String,
|
||||
@JsonProperty("image") val image: String,
|
||||
@JsonProperty("name") val name: String
|
||||
)
|
||||
|
||||
companion object {
|
||||
fun getStatus(t: String?): ShowStatus? {
|
||||
return when (t?.lowercase()) {
|
||||
|
@ -91,6 +100,17 @@ class AnimeSaturnProvider : MainAPI() {
|
|||
return HomePageResponse(list)
|
||||
}
|
||||
|
||||
override suspend fun quickSearch(query: String): List<SearchResponse>? {
|
||||
val quickSearchJ = app.get("$mainUrl/index.php?search=1&key=$query").text
|
||||
return tryParseJson<List<QuickSearchParse>>(quickSearchJ)?.map {
|
||||
newAnimeSearchResponse(it.name.replace(" (ITA)", ""), it.link, TvType.Anime) {
|
||||
addDubStatus(it.name.contains(" (ITA)"))
|
||||
this.posterUrl = it.image
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val document = app.get("$mainUrl/animelist?search=$query").document
|
||||
return document.select("div.item-archivio").map {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue