mirror of
				https://github.com/hexated/cloudstream-extensions-hexated.git
				synced 2024-08-15 00:03:22 +00:00 
			
		
		
		
	Merge pull request #13 from KillerDogeEmpire/master
Updated Animixplay search
This commit is contained in:
		
						commit
						dc7fdd2d01
					
				
					 2 changed files with 188 additions and 163 deletions
				
			
		|  | @ -1,5 +1,5 @@ | |||
| // use an integer for version numbers | ||||
| version = 2 | ||||
| version = 3 | ||||
| 
 | ||||
| 
 | ||||
| cloudstream { | ||||
|  |  | |||
|  | @ -7,6 +7,7 @@ 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.loadExtractor | ||||
| import org.json.JSONObject | ||||
| import org.jsoup.Jsoup | ||||
| import java.net.URI | ||||
| 
 | ||||
|  | @ -130,9 +131,31 @@ class Animixplay : MainAPI() { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     override suspend fun quickSearch(query: String) = search(query) | ||||
| 
 | ||||
|     override suspend fun search(query: String): List<SearchResponse>? { | ||||
|         return app.post( | ||||
|             url = "https://v1.ij7p9towl8uj4qafsopjtrjk.workers.dev", | ||||
|             referer = mainUrl, | ||||
|             data = mapOf( | ||||
|                 "q2" to query, | ||||
|                 "origin" to "1", | ||||
|                 "root" to "animixplay.to", | ||||
|                 "d" to "gogoanime.tel" | ||||
|             ) | ||||
|         ).parsedSafe<FullSearch>()?.result?.let { | ||||
|             Jsoup.parse(it).select("div").map { elem -> | ||||
| 
 | ||||
|                 val href = fixUrl(elem.select("a").attr("href")) | ||||
|                 val title = elem.select("a").attr("title") | ||||
|                 newAnimeSearchResponse(title, href, TvType.Anime) { | ||||
|                     this.posterUrl = elem.select("img").attr("src") | ||||
|                     addDubStatus(isDub = title.contains("Dub")) | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|         override suspend fun quickSearch(query: String): List<SearchResponse>? { | ||||
|             return app.post( | ||||
|                 "https://cdn.animixplay.to/api/search", | ||||
|                 data = mapOf("qfast" to query, "root" to URI(mainUrl).host) | ||||
|  | @ -148,6 +171,7 @@ class Animixplay : MainAPI() { | |||
|             } | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         override suspend fun load(url: String): LoadResponse? { | ||||
| 
 | ||||
|             val (fixUrl, malId) = if (url.contains("/anime/")) { | ||||
|  | @ -257,9 +281,6 @@ class Animixplay : MainAPI() { | |||
|             return true | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|         private data class IdAni( | ||||
|             @JsonProperty("id") val id: String? = null, | ||||
|         ) | ||||
|  | @ -332,4 +353,8 @@ class Animixplay : MainAPI() { | |||
|             @JsonProperty("infotext") val infotext: String? = null, | ||||
|         ) | ||||
| 
 | ||||
|         private data class FullSearch( | ||||
|         @JsonProperty("result") val result: String? = null, | ||||
|     ) | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue