From 77853c586a71ec8dd48ad505edeba17df4c09eca Mon Sep 17 00:00:00 2001 From: hexated Date: Sun, 27 Nov 2022 16:06:00 +0700 Subject: [PATCH] fixed TimefourTv --- TimefourTv/build.gradle.kts | 2 +- TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TimefourTv/build.gradle.kts b/TimefourTv/build.gradle.kts index bc48adde..417313d9 100644 --- a/TimefourTv/build.gradle.kts +++ b/TimefourTv/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 8 +version = 9 cloudstream { diff --git a/TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt b/TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt index 2aed1b57..874a9e4b 100644 --- a/TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt +++ b/TimefourTv/src/main/kotlin/com/hexated/TimefourTv.kt @@ -38,7 +38,7 @@ open class TimefourTv : MainAPI() { val home = res.select("div.tab-content ul li").mapNotNull { it.toSearchResult() } - items.add(HomePageList(request.name, home, true)) + if(home.isNotEmpty()) items.add(HomePageList(request.name, home, true)) } if (request.name == "All Channels") { val res = if (page == 1) { @@ -49,12 +49,12 @@ open class TimefourTv : MainAPI() { val home = res.select("div.tab-content ul li").mapNotNull { it.toSearchResult() } - items.add(HomePageList(request.name, home, true)) + if(home.isNotEmpty()) items.add(HomePageList(request.name, home, true)) } if (nonPaged && request.name == "Schedule") { val res = app.get(request.data).document - val schedule = res.select("div.search_p h2").mapNotNull { + val schedule = res.select("div.search_p h1,div.search_p h2").mapNotNull { it.toSearchSchedule() } items.add(HomePageList(request.name, schedule, true)) @@ -88,8 +88,8 @@ open class TimefourTv : MainAPI() { val name = url.removePrefix("$mainUrl/") val doc = app.get("$mainUrl/schedule.php").document val episode = mutableListOf() - doc.selectFirst("div.search_p h2:contains($name)")?.nextElementSiblings()?.toString() - ?.substringBefore("")?.map { + doc.selectFirst("div.search_p h1:contains($name)")?.nextElementSiblings()?.toString() + ?.substringBefore("")?.map { val desc = it.substringBefore(""), "").replace("

", "") Jsoup.parse(it).select("span").map { ele -> val title = ele.select("a").text()