From 051a72d378bf8c8cc591e4900e08fb98ad64e1b2 Mon Sep 17 00:00:00 2001 From: Eddy Date: Tue, 15 Nov 2022 21:59:33 +0100 Subject: [PATCH] fix mainurl --- .../main/kotlin/com/lagradost/MacIPTVProvider.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/MaciptvProvider/src/main/kotlin/com/lagradost/MacIPTVProvider.kt b/MaciptvProvider/src/main/kotlin/com/lagradost/MacIPTVProvider.kt index c86ea92..337a2c6 100644 --- a/MaciptvProvider/src/main/kotlin/com/lagradost/MacIPTVProvider.kt +++ b/MaciptvProvider/src/main/kotlin/com/lagradost/MacIPTVProvider.kt @@ -72,6 +72,12 @@ class MacIPTVProvider(override var lang: String) : MainAPI() { if (tags?.uppercase()?.trim() == "NONE" || tags?.isBlank() == true) tags = lang tags = tags?.uppercase() 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 { accountInfoNotGood(mainUrl, loginMac) -> { // do this if mainUrl or mac adresse is blank 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( "$mainUrl/portal.php?type=stb&action=get_modules", headers = headerMac