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 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()
}
return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = true)
}
private fun Element.toSearchResult(): SearchResponse {
val title = this.selectFirst("a")?.attr("title")
val link = this.selectFirst("a")?.attr("href")
private fun Element.toSearchResult(): SearchResponse? {
val title = this.selectFirst("a")?.attr("title") ?: return null
val link = this.selectFirst("a")?.attr("href") ?: return null
val image = fixUrlNull(mainUrl + this.selectFirst("img")?.attr("src")?.trim())
return newTvSeriesSearchResponse(title, link, TvType.TvSeries){