diff --git a/TimefourTv/build.gradle.kts b/TimefourTv/build.gradle.kts index 94baec33..bc48adde 100644 --- a/TimefourTv/build.gradle.kts +++ b/TimefourTv/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 7 +version = 8 cloudstream { diff --git a/TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt b/TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt index 7086de59..c1d65629 100644 --- a/TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt +++ b/TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt @@ -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(" + val episode = mutableListOf() + doc.selectFirst("div.search_p h2:contains($name)")?.nextElementSiblings()?.toString() + ?.substringBefore("")?.map { + val desc = it.substringBefore(""), "").replace("

", "") + 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) { }