fix shortcodes

This commit is contained in:
Cloudburst 2023-04-21 13:54:58 +02:00
parent bdb45b69d3
commit a12d234ef4
2 changed files with 5 additions and 10 deletions

View File

@ -95,15 +95,11 @@ object RepositoryManager {
} }
} else if (fixedUrl.matches("^[a-zA-Z0-9!_-]+$".toRegex())) { } else if (fixedUrl.matches("^[a-zA-Z0-9!_-]+$".toRegex())) {
suspendSafeApiCall { suspendSafeApiCall {
app.get("https://l.cloudstream.cf/${fixedUrl}", allowRedirects = false).let { app.get("https://cutt.ly/${fixedUrl}", allowRedirects = false).let { it2 ->
it.headers["Location"]?.let { url -> it2.headers["Location"]?.let { url ->
return@suspendSafeApiCall if (!url.startsWith("https://cutt.ly/branded-domains")) url if (url.startsWith("https://cutt.ly/404")) return@suspendSafeApiCall null
else null if (url.removeSuffix("/") == "https://cutt.ly") return@suspendSafeApiCall null
} return@suspendSafeApiCall url
app.get("https://cutt.ly/${fixedUrl}", allowRedirects = false).let { it2 ->
it2.headers["Location"]?.let { url ->
return@suspendSafeApiCall if (url.startsWith("https://cutt.ly/404")) url else null
}
} }
} }
} }

View File

@ -1,6 +1,5 @@
package com.lagradost.cloudstream3.ui.settings.extensions package com.lagradost.cloudstream3.ui.settings.extensions
import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
import android.content.Context import android.content.Context
import android.content.DialogInterface import android.content.DialogInterface