try to fix crash theflixto
This commit is contained in:
parent
636bfe638e
commit
05272ed423
|
@ -271,8 +271,9 @@ class SuperStream : MainAPI() {
|
|||
)
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
println("query: $query")
|
||||
val parsedFilter = tryParseJson<TmdbProviderSearchFilter>(query)
|
||||
val query = parsedFilter?.title ?: throw ErrorLoadingException()
|
||||
val searchedTitle = parsedFilter?.title ?: throw ErrorLoadingException()
|
||||
|
||||
val searchType = when (parsedFilter.type) {
|
||||
TvType.TvSeries -> TYPE_SERIES
|
||||
|
@ -283,7 +284,7 @@ class SuperStream : MainAPI() {
|
|||
}.toString()
|
||||
val apiQuery =
|
||||
// Originally 8 pagelimit
|
||||
"""{"childmode":"$hideNsfw","app_version":"11.5","appid":"$appId","module":"Search3","channel":"Website","page":"1","lang":"en","type":$searchType,"keyword":"$query","pagelimit":"20","expired_date":"${getExpiryDate()}","platform":"android"}"""
|
||||
"""{"childmode":"$hideNsfw","app_version":"11.5","appid":"$appId","module":"Search3","channel":"Website","page":"1","lang":"en","type":$searchType,"keyword":"$searchedTitle","pagelimit":"20","expired_date":"${getExpiryDate()}","platform":"android"}"""
|
||||
val output = queryApi(apiQuery).text
|
||||
|
||||
val searchResponse = parseJson<MainData>(output).data.first {
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.lagradost.cloudstream3.*
|
|||
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
||||
import com.lagradost.cloudstream3.utils.AppUtils
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.getQualityFromName
|
||||
|
||||
|
@ -228,8 +229,8 @@ class TheFlixToProvider : MainAPI() {
|
|||
)
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
|
||||
val parsedFilter = AppUtils.tryParseJson<TmdbProviderSearchFilter>(query)
|
||||
println("query: $query")
|
||||
val parsedFilter = tryParseJson<TmdbProviderSearchFilter>(query)
|
||||
val searchTitle = parsedFilter?.title ?: throw ErrorLoadingException()
|
||||
|
||||
val yearFilter = if(parsedFilter.tmdbYear != null) {
|
||||
|
@ -267,7 +268,8 @@ class TheFlixToProvider : MainAPI() {
|
|||
this.name,
|
||||
TvType.Movie,
|
||||
poster,
|
||||
null
|
||||
null,
|
||||
|
||||
)
|
||||
)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue