Compare commits

...

2 commits

Author SHA1 Message Date
f34f268690
vodnerilo: Dead
All checks were successful
Build / build (push) Successful in 2m19s
2024-11-07 07:44:58 +02:00
d265f92a0d
uaserial: Fix search 2024-11-07 07:44:42 +02:00
4 changed files with 25 additions and 12 deletions

View file

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

View file

@ -7,6 +7,7 @@ import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper
import com.lagradost.models.GeneralInfo
import com.lagradost.models.GeneralInfoMovie
import com.lagradost.models.SearchModel
import org.jsoup.nodes.Element
open class UASerialProvider(url: String, name: String) : MainAPI() {
@ -53,17 +54,16 @@ open class UASerialProvider(url: String, name: String) : MainAPI() {
}
override suspend fun search(query: String): List<SearchResponse> {
val document = app.post(
url = mainUrl,
data = mapOf(
"do" to "search",
"subaction" to "search",
"story" to query.replace(" ", "+")
)
).document
val searchResult = app.get(
url = "$mainUrl/search-ajax?query=$query",
).text
return document.select("article.short").map {
it.toSearchResponse()
val searchJson = Gson().fromJson(searchResult, SearchModel::class.java)
return searchJson.movies.map {
newMovieSearchResponse(it.name, it.link, TvType.Movie) {
this.posterUrl = "$mainUrl${it.poster}"
}
}
}

View file

@ -0,0 +1,13 @@
package com.lagradost.models
import com.google.gson.annotations.SerializedName
data class SearchModel (
@SerializedName("movies") val movies : List<Movies>,
)
data class Movies (
@SerializedName("link") val link : String,
@SerializedName("name") val name : String,
@SerializedName("poster") val poster : String
)

View file

@ -19,7 +19,7 @@ cloudstream {
* 2: Slow
* 3: Beta only
* */
status = 1 // will be 3 if unspecified
status = 0 // will be 3 if unspecified
iconUrl = "https://www.google.com/s2/favicons?domain=vodnerilo.com&sz=%size%"
}