From d7a075807d40b79c925a216cb85bbd77e9152700 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Sat, 23 May 2026 16:15:55 -0600 Subject: [PATCH] Use StringUtils.decodeUri in a couple places Gives us just one place to update the API when we get there --- .../kotlin/com/lagradost/cloudstream3/extractors/Cda.kt | 4 ++-- .../kotlin/com/lagradost/cloudstream3/utils/UnshortenUrl.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Cda.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Cda.kt index e37c498f972..4b7f8a1cd3d 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Cda.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Cda.kt @@ -6,8 +6,8 @@ import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.Qualities +import com.lagradost.cloudstream3.utils.StringUtils.decodeUri import com.lagradost.cloudstream3.utils.newExtractorLink -import java.net.URLDecoder open class Cda : ExtractorApi() { override var mainUrl = "https://ebd.cda.pl" @@ -64,7 +64,7 @@ open class Cda : ExtractorApi() { .replace("_QWE", "") .replace("_Q5", "") .replace("_IKSDE", "") - a = URLDecoder.decode(a, "UTF-8") + a = a.decodeUri() a = a.map { char -> if (char.code in 33..126) { return@map (33 + (char.code + 14) % 94).toChar().toString() diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/UnshortenUrl.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/UnshortenUrl.kt index 206b0f29fe1..6d9862d3a3e 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/UnshortenUrl.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/UnshortenUrl.kt @@ -2,9 +2,9 @@ package com.lagradost.cloudstream3.utils import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.base64Decode +import com.lagradost.cloudstream3.utils.StringUtils.decodeUri import com.lagradost.nicehttp.NiceResponse import java.net.URI -import java.net.URLDecoder // Code heavily based on unshortenit.py form kodiondemand /addon @@ -189,7 +189,7 @@ object ShortLink { } fun unshortenDavisonbarker(uri: String): String { - return URLDecoder.decode(uri.substringAfter("dest="), "UTF-8") + return uri.substringAfter("dest=").decodeUri() } suspend fun unshortenIsecure(uri: String): String {