From a67a4e567d2087626a74daec1f29580137e7059b Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Sat, 23 May 2026 11:42:20 -0600 Subject: [PATCH] Replace Integer.parseInt with Kotlin-native equivalent --- .../cloudstream3/extractors/OdnoklassnikiExtractor.kt | 2 +- .../kotlin/com/lagradost/cloudstream3/extractors/Vidsonic.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/OdnoklassnikiExtractor.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/OdnoklassnikiExtractor.kt index 8af77c1dfc6..69c3b775978 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/OdnoklassnikiExtractor.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/OdnoklassnikiExtractor.kt @@ -32,7 +32,7 @@ open class Odnoklassniki : ExtractorApi() { val embedUrl = url.replace("/video/","/videoembed/") val videoReq = app.get(embedUrl, headers=headers).text.replace("\\"", "\"").replace("\\\\", "\\") .replace(Regex("\\\\u([0-9A-Fa-f]{4})")) { matchResult -> - Integer.parseInt(matchResult.groupValues[1], 16).toChar().toString() + matchResult.groupValues[1].toInt(16).toChar().toString() } val videosStr = Regex(""""videos":(\[[^]]*])""").find(videoReq)?.groupValues?.get(1) ?: throw ErrorLoadingException("Video not found") val videos = AppUtils.tryParseJson>(videosStr) ?: throw ErrorLoadingException("Video not found") diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Vidsonic.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Vidsonic.kt index 5c871b54b93..49560d45689 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Vidsonic.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Vidsonic.kt @@ -38,13 +38,13 @@ class Vidsonic() : ExtractorApi() { .substringBefore(";") .replace("'", "") - // (improved) Java implementation of the JavaScript code from above + // (improved) Kotlin implementation of the JavaScript code from above val streamUrl = encodedStreamUrl .replace("|", "") // always two base16 digits together build one ASCII char .chunked(2) .map { - Integer.parseInt(it, 16).toChar() + it.toInt(16).toChar() } .joinToString("") .reversed()