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
|
// use an integer for version numbers
|
||||||
version = 7
|
version = 8
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -89,21 +89,23 @@ open class TimefourTv : MainAPI() {
|
||||||
private suspend fun loadSchedule(url: String): LoadResponse {
|
private suspend fun loadSchedule(url: String): LoadResponse {
|
||||||
val name = url.removePrefix("$mainUrl/")
|
val name = url.removePrefix("$mainUrl/")
|
||||||
val doc = app.get("$mainUrl/schedule.php").document
|
val doc = app.get("$mainUrl/schedule.php").document
|
||||||
|
val episode = mutableListOf<Episode>()
|
||||||
val episode =
|
doc.selectFirst("div.search_p h2:contains($name)")?.nextElementSiblings()?.toString()
|
||||||
doc.selectFirst("div.search_p h2:contains($name)")?.nextElementSiblings()?.toString()
|
?.substringBefore("<h2")?.split("<br>")?.map {
|
||||||
?.substringBefore("<h2")?.let { Jsoup.parse(it) }?.select("span")
|
val desc = it.substringBefore("<span").replace(Regex("</?strong>"), "").replace("<p>", "")
|
||||||
?.mapIndexed { index, ele ->
|
Jsoup.parse(it).select("span").map { ele ->
|
||||||
val title = ele.select("a").text()
|
val title = ele.select("a").text()
|
||||||
val href = ele.select("a").attr("href")
|
val href = ele.select("a").attr("href")
|
||||||
val desc = ele.parent()?.textNodes()?.getOrNull(index)?.toString()
|
episode.add(
|
||||||
Episode(
|
Episode(
|
||||||
href,
|
href,
|
||||||
title,
|
title,
|
||||||
posterUrl = time4tvPoster,
|
description = desc,
|
||||||
description = desc,
|
posterUrl = time4tvPoster
|
||||||
|
)
|
||||||
)
|
)
|
||||||
} ?: throw ErrorLoadingException("Referest Page")
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return newTvSeriesLoadResponse(name, url, TvType.TvSeries, episode) {
|
return newTvSeriesLoadResponse(name, url, TvType.TvSeries, episode) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue