mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed desc in TimefourTv schedule
This commit is contained in:
parent
bbf2e244e1
commit
03808b37a0
2 changed files with 15 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 7
|
||||
version = 8
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -89,21 +89,23 @@ open class TimefourTv : MainAPI() {
|
|||
private suspend fun loadSchedule(url: String): LoadResponse {
|
||||
val name = url.removePrefix("$mainUrl/")
|
||||
val doc = app.get("$mainUrl/schedule.php").document
|
||||
|
||||
val episode =
|
||||
doc.selectFirst("div.search_p h2:contains($name)")?.nextElementSiblings()?.toString()
|
||||
?.substringBefore("<h2")?.let { Jsoup.parse(it) }?.select("span")
|
||||
?.mapIndexed { index, ele ->
|
||||
val episode = mutableListOf<Episode>()
|
||||
doc.selectFirst("div.search_p h2:contains($name)")?.nextElementSiblings()?.toString()
|
||||
?.substringBefore("<h2")?.split("<br>")?.map {
|
||||
val desc = it.substringBefore("<span").replace(Regex("</?strong>"), "").replace("<p>", "")
|
||||
Jsoup.parse(it).select("span").map { ele ->
|
||||
val title = ele.select("a").text()
|
||||
val href = ele.select("a").attr("href")
|
||||
val desc = ele.parent()?.textNodes()?.getOrNull(index)?.toString()
|
||||
Episode(
|
||||
href,
|
||||
title,
|
||||
posterUrl = time4tvPoster,
|
||||
description = desc,
|
||||
episode.add(
|
||||
Episode(
|
||||
href,
|
||||
title,
|
||||
description = desc,
|
||||
posterUrl = time4tvPoster
|
||||
)
|
||||
)
|
||||
} ?: throw ErrorLoadingException("Referest Page")
|
||||
}
|
||||
}
|
||||
|
||||
return newTvSeriesLoadResponse(name, url, TvType.TvSeries, episode) {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue