Update EurostreamingProvider.kt

This commit is contained in:
Cloudburst 2022-11-29 11:37:41 +01:00 committed by GitHub
parent 29a1e11e4e
commit 89b344b132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,15 +29,15 @@ class EurostreamingProvider : MainAPI() {
val url = request.data + page val url = request.data + page
val soup = app.get(url, interceptor = interceptor).document val soup = app.get(url, interceptor = interceptor).document
val home = soup.select("div.post-thumb").map { val home = soup.select("div.post-thumb").mapNotNull {
it.toSearchResult() it.toSearchResult()
} }
return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = true) return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = true)
} }
private fun Element.toSearchResult(): SearchResponse { private fun Element.toSearchResult(): SearchResponse? {
val title = this.selectFirst("a")?.attr("title") val title = this.selectFirst("a")?.attr("title") ?: return null
val link = this.selectFirst("a")?.attr("href") val link = this.selectFirst("a")?.attr("href") ?: return null
val image = fixUrlNull(mainUrl + this.selectFirst("img")?.attr("src")?.trim()) val image = fixUrlNull(mainUrl + this.selectFirst("img")?.attr("src")?.trim())
return newTvSeriesSearchResponse(title, link, TvType.TvSeries){ return newTvSeriesSearchResponse(title, link, TvType.TvSeries){