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())) {
suspendSafeApiCall {
app.get("https://l.cloudstream.cf/${fixedUrl}", allowRedirects = false).let {
it.headers["Location"]?.let { url ->
return@suspendSafeApiCall if (!url.startsWith("https://cutt.ly/branded-domains")) url
else null
}
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
}
app.get("https://cutt.ly/${fixedUrl}", allowRedirects = false).let { it2 ->
it2.headers["Location"]?.let { url ->
if (url.startsWith("https://cutt.ly/404")) return@suspendSafeApiCall null
if (url.removeSuffix("/") == "https://cutt.ly") return@suspendSafeApiCall null
return@suspendSafeApiCall url
}
}
}

View file

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