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