mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
fix mainurl
This commit is contained in:
parent
fbe6ad3fa2
commit
051a72d378
1 changed files with 7 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue