Fix description and poster in recommendations

Fix description and poster in recommendations
This commit is contained in:
tuan041 2022-09-03 15:39:45 +07:00 committed by Cloudburst
parent e9f40bc0ce
commit bbac931833

View file

@ -89,15 +89,24 @@ class PhimmoichillProvider : MainAPI() {
.toIntOrNull() .toIntOrNull()
val tvType = if (document.select("div.latest-episode").isNotEmpty() val tvType = if (document.select("div.latest-episode").isNotEmpty()
) TvType.TvSeries else TvType.Movie ) TvType.TvSeries else TvType.Movie
val description = document.select("div#film-content-wrapper").text().trim() val description = document.select("div#film-content").text().trim()
val trailer = val trailer =
document.select("div#trailer script").last()?.data()?.substringAfter("file: \"") document.select("div#trailer script").last()?.data()?.substringAfter("file: \"")
?.substringBefore("\",") ?.substringBefore("\",")
val rating = val rating =
document.select("ul.entry-meta.block-film li:nth-child(7) span").text().toRatingInt() document.select("ul.entry-meta.block-film li:nth-child(7) span").text().toRatingInt()
val actors = document.select("ul.entry-meta.block-film li:last-child a").map { it.text() } val actors = document.select("ul.entry-meta.block-film li:last-child a").map { it.text() }
val recommendations = document.select("ul#list-film-realted li.item").map { val recommendations = document.select("ul#list-film-realted li.item").mapNotNull {
it.toSearchResult() val titleHeader = element.select("li.item > p") ?: return null
val recUrl = fixUrlNull(titleHeader.attr("href")) ?: return null
val recTitle = titleHeader.text() ?: return null
val poster = element.select("li.item > .lazyloaded > img").attr("src")
MovieSearchResponse(
recTitle,
recUrl,
this.name,
poster
)
} }
return if (tvType == TvType.TvSeries) { return if (tvType == TvType.TvSeries) {