fix mainurl

This commit is contained in:
Eddy 2022-11-15 21:59:33 +01:00
parent fbe6ad3fa2
commit 051a72d378

View file

@ -72,6 +72,12 @@ class MacIPTVProvider(override var lang: String) : MainAPI() {
if (tags?.uppercase()?.trim() == "NONE" || tags?.isBlank() == true) tags = lang if (tags?.uppercase()?.trim() == "NONE" || tags?.isBlank() == true) tags = lang
tags = tags?.uppercase() tags = tags?.uppercase()
mainUrl = overrideUrl.toString() mainUrl = overrideUrl.toString()
mainUrl = when (true) { // the "c" is not needed and some provider doesn't work with it
mainUrl.endsWith("/c/") -> mainUrl.dropLast(3)
mainUrl.endsWith("/c") -> mainUrl.dropLast(2)
mainUrl.endsWith("/") -> mainUrl.dropLast(1)
else -> mainUrl
}
headerMac = when { headerMac = when {
accountInfoNotGood(mainUrl, loginMac) -> { // do this if mainUrl or mac adresse is blank accountInfoNotGood(mainUrl, loginMac) -> { // do this if mainUrl or mac adresse is blank
mainUrl = defaultmainUrl mainUrl = defaultmainUrl
@ -109,12 +115,7 @@ class MacIPTVProvider(override var lang: String) : MainAPI() {
} }
} }
} }
mainUrl = when (true) { // the "c" is not needed and some provider doesn't work with it
mainUrl.endsWith("/c/") -> mainUrl.dropLast(3)
mainUrl.endsWith("/c") -> mainUrl.dropLast(2)
mainUrl.endsWith("/") -> mainUrl.dropLast(1)
else -> mainUrl
}
app.get( app.get(
"$mainUrl/portal.php?type=stb&action=get_modules", "$mainUrl/portal.php?type=stb&action=get_modules",
headers = headerMac headers = headerMac