Skip to content

Commit 62b3c69

Browse files
authored
fix vidstreaming extractor (recloudstream#1393)
1 parent 217cf41 commit 62b3c69

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/helper

library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/helper/GogoHelper.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ object GogoHelper {
107107
"$mainUrl/encrypt-ajax.php?$encryptRequestData",
108108
headers = mapOf("X-Requested-With" to "XMLHttpRequest")
109109
)
110-
val dataencrypted =
111-
jsonResponse.text.substringAfter("{\"data\":\"").substringBefore("\"}")
110+
val dataencrypted = jsonResponse.parsedSafe<GogoJsonData>()?.data ?: return@safeApiCall
112111
val datadecrypted = cryptoHandler(dataencrypted, foundIv, foundDecryptKey, false)
113112
val sources = AppUtils.parseJson<GogoSources>(datadecrypted)
114113

@@ -155,4 +154,8 @@ object GogoHelper {
155154
@JsonProperty("type") val type: String?,
156155
@JsonProperty("default") val default: String? = null
157156
)
157+
158+
data class GogoJsonData(
159+
@JsonProperty("data") val data: String? = null
160+
)
158161
}

0 commit comments

Comments
 (0)