diff --git a/app/src/main/java/awais/instagrabber/webservices/GraphQLRepository.kt b/app/src/main/java/awais/instagrabber/webservices/GraphQLRepository.kt
index d4ec39a4..027fc63a 100644
--- a/app/src/main/java/awais/instagrabber/webservices/GraphQLRepository.kt
+++ b/app/src/main/java/awais/instagrabber/webservices/GraphQLRepository.kt
@@ -1,12 +1,12 @@
package awais.instagrabber.webservices
import android.util.Log
+import awais.instagrabber.models.enums.FollowingType
import awais.instagrabber.repositories.GraphQLService
import awais.instagrabber.repositories.responses.*
import awais.instagrabber.utils.Constants
import awais.instagrabber.utils.ResponseBodyUtils
import awais.instagrabber.utils.extensions.TAG
-import com.google.gson.Gson
import org.json.JSONException
import org.json.JSONObject
import java.util.*
@@ -181,9 +181,9 @@ class GraphQLRepository(private val service: GraphQLService) {
): User {
val response = service.getUser(username)
val body = JSONObject(response
- .split("", false, 2).get(0)
- .trim().replace(Regex("};$"), "}"))
+ .split("").get(0)
+ .trim().replace(Regex("\\};$"), "}"))
val userJson = body
.getJSONObject("entry_data")
.getJSONArray("ProfilePage")
@@ -241,9 +241,9 @@ class GraphQLRepository(private val service: GraphQLService) {
): Hashtag {
val response = service.getTag(tag)
val body = JSONObject(response
- .split("", false, 2).get(0)
- .trim().replace(Regex("};$"), "}"))
+ .split("").get(0)
+ .trim().replace(Regex("\\};$"), "}"))
.getJSONObject("entry_data")
.getJSONArray("TagPage")
.getJSONObject(0)
@@ -265,8 +265,7 @@ class GraphQLRepository(private val service: GraphQLService) {
): Location {
val response = service.getLocation(locationId)
val body = JSONObject(response
- .split("", false, 2).get(0)
+ .split("").get(1)
.trim().replace(Regex("};$"), "}"))
.getJSONObject("entry_data")
.getJSONArray("LocationsPage")