TimefourTv: fix DaddyHD Channels

This commit is contained in:
hexated 2023-07-21 00:49:46 +07:00
parent 8b9a58a5a0
commit 65f5283ae6
3 changed files with 7 additions and 4 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 14 version = 15
cloudstream { cloudstream {

View file

@ -19,8 +19,11 @@ open class TimefourTv : MainAPI() {
) )
companion object { companion object {
const val daddyUrl = "https://daddylive.watch" const val daddyUrl = "https://d.daddylivehd.sx"
val daddyHost: String = URI(daddyUrl).host.split(".").first() val daddyHost: String = daddyUrl.getHost()
private fun String.getHost(): String {
return URI(this).host.substringBeforeLast(".").substringAfterLast(".")
}
} }
override val mainPage = mainPageOf( override val mainPage = mainPageOf(

View file

@ -72,7 +72,7 @@ object TimefourTvExtractor : TimefourTv() {
return getSportLink(url) return getSportLink(url)
} }
if(url.contains(daddyHost)) { if(url.contains(daddyHost, true)) {
mainServer = getBaseUrl(url) mainServer = getBaseUrl(url)
return getFinalLink(app.get(url, referer = daddyUrl)) return getFinalLink(app.get(url, referer = daddyUrl))
} }