diff --git a/HigoTVProvider/build.gradle.kts b/HigoTVProvider/build.gradle.kts index 3f19dcc..da45a6f 100644 --- a/HigoTVProvider/build.gradle.kts +++ b/HigoTVProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 6 +version = 7 dependencies{ implementation("com.google.code.gson:gson:2.9.0") diff --git a/HigoTVProvider/src/main/kotlin/com/lagradost/HigoTVProvider.kt b/HigoTVProvider/src/main/kotlin/com/lagradost/HigoTVProvider.kt index e1edb61..9bcc33c 100644 --- a/HigoTVProvider/src/main/kotlin/com/lagradost/HigoTVProvider.kt +++ b/HigoTVProvider/src/main/kotlin/com/lagradost/HigoTVProvider.kt @@ -25,6 +25,7 @@ import com.lagradost.cloudstream3.toRatingInt import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.M3u8Helper import com.lagradost.models.PlayerJson +import com.lagradost.models.Search import org.jsoup.nodes.Element @@ -38,7 +39,7 @@ class HigoTVProvider : MainAPI() { override val hasDownloadSupport = true override val supportedTypes = setOf(TvType.Anime) - private val searchUrl = "https://higotv.fun/search/doSearch" + private val searchUrl = "$mainUrl/search?query=" // Sections override val mainPage = @@ -62,6 +63,7 @@ class HigoTVProvider : MainAPI() { private val ratingSelector = ".rt-tb" private val listPlayer = object : TypeToken>() {}.type + private val listSearch = object : TypeToken>() {}.type private val TAG = "$name-Debug" @@ -90,9 +92,14 @@ class HigoTVProvider : MainAPI() { } override suspend fun search(query: String): List { - val document = app.post(url = searchUrl, data = mapOf("keyword" to query)).document - - return document.select(animeSelector).map { it.toSearchResponse() } + val document = app.get(searchUrl + query).text + return gson.fromJson>(document, listSearch).map { + newAnimeSearchResponse(it.name, "$mainUrl/movies/view/${it.slug}", TvType.Anime) { + // this.otherName = engTitle + this.posterUrl = it.poster + addDubStatus(isDub = true) + } + } } // Detailed information diff --git a/HigoTVProvider/src/main/kotlin/com/lagradost/models/Search.kt b/HigoTVProvider/src/main/kotlin/com/lagradost/models/Search.kt new file mode 100644 index 0000000..822cd58 --- /dev/null +++ b/HigoTVProvider/src/main/kotlin/com/lagradost/models/Search.kt @@ -0,0 +1,26 @@ +package com.lagradost.models + +data class Search ( + + val id : Int, + val slug : String, + val name : String, + val longname : String, + val engname : String, + val age : String, + val genre : String, + val year : Int, + val add_date : String, + val country : String, + val flagicon : String, + val regiser : String, + val studio : String, + val serii : String, + val stan : String, + val rating : Int, + val description : String, + val info_pro_anime : String, + val poster : String, + val trailer : String, + val typeofanime : String, +) \ No newline at end of file