From 62b3c697d6f851693fa11d504068ae8f9da94bb3 Mon Sep 17 00:00:00 2001 From: RowdyRushya Date: Fri, 25 Oct 2024 08:30:04 -0700 Subject: [PATCH] fix vidstreaming extractor (#1393) --- .../lagradost/cloudstream3/extractors/helper/GogoHelper.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/helper/GogoHelper.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/helper/GogoHelper.kt index 1766af6cf3..35c23b2f71 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/helper/GogoHelper.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/helper/GogoHelper.kt @@ -107,8 +107,7 @@ object GogoHelper { "$mainUrl/encrypt-ajax.php?$encryptRequestData", headers = mapOf("X-Requested-With" to "XMLHttpRequest") ) - val dataencrypted = - jsonResponse.text.substringAfter("{\"data\":\"").substringBefore("\"}") + val dataencrypted = jsonResponse.parsedSafe()?.data ?: return@safeApiCall val datadecrypted = cryptoHandler(dataencrypted, foundIv, foundDecryptKey, false) val sources = AppUtils.parseJson(datadecrypted) @@ -155,4 +154,8 @@ object GogoHelper { @JsonProperty("type") val type: String?, @JsonProperty("default") val default: String? = null ) + + data class GogoJsonData( + @JsonProperty("data") val data: String? = null + ) } \ No newline at end of file