higotv: Fix search
All checks were successful
Build / build (push) Successful in 1m35s

This commit is contained in:
CakesTwix 2024-08-17 21:37:31 +03:00
parent e993ef6e2d
commit dd74d87cd8
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
3 changed files with 38 additions and 5 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 6 version = 7
dependencies{ dependencies{
implementation("com.google.code.gson:gson:2.9.0") implementation("com.google.code.gson:gson:2.9.0")

View file

@ -25,6 +25,7 @@ import com.lagradost.cloudstream3.toRatingInt
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper import com.lagradost.cloudstream3.utils.M3u8Helper
import com.lagradost.models.PlayerJson import com.lagradost.models.PlayerJson
import com.lagradost.models.Search
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
@ -38,7 +39,7 @@ class HigoTVProvider : MainAPI() {
override val hasDownloadSupport = true override val hasDownloadSupport = true
override val supportedTypes = setOf(TvType.Anime) override val supportedTypes = setOf(TvType.Anime)
private val searchUrl = "https://higotv.fun/search/doSearch" private val searchUrl = "$mainUrl/search?query="
// Sections // Sections
override val mainPage = override val mainPage =
@ -62,6 +63,7 @@ class HigoTVProvider : MainAPI() {
private val ratingSelector = ".rt-tb" private val ratingSelector = ".rt-tb"
private val listPlayer = object : TypeToken<List<PlayerJson>>() {}.type private val listPlayer = object : TypeToken<List<PlayerJson>>() {}.type
private val listSearch = object : TypeToken<List<Search>>() {}.type
private val TAG = "$name-Debug" private val TAG = "$name-Debug"
@ -90,9 +92,14 @@ class HigoTVProvider : MainAPI() {
} }
override suspend fun search(query: String): List<SearchResponse> { override suspend fun search(query: String): List<SearchResponse> {
val document = app.post(url = searchUrl, data = mapOf("keyword" to query)).document val document = app.get(searchUrl + query).text
return gson.fromJson<List<Search>>(document, listSearch).map {
return document.select(animeSelector).map { it.toSearchResponse() } newAnimeSearchResponse(it.name, "$mainUrl/movies/view/${it.slug}", TvType.Anime) {
// this.otherName = engTitle
this.posterUrl = it.poster
addDubStatus(isDub = true)
}
}
} }
// Detailed information // Detailed information

View file

@ -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,
)