File tree Expand file tree Collapse file tree
src/commonMain/kotlin/com/mugames/vidsnapkit/extractor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ plugins {
2424}
2525
2626group = " io.github.udhayarajan"
27- version = " 3.2 .0"
27+ version = " 3.3 .0"
2828// Version Naming incremented if "<NEW_FEATURE_ADDED>.<WORKED_ON_BUG>.<BETA_VERSION_COUNT>"
2929// Priority on incrementing Feature > BugFix > Beta
3030repositories {
Original file line number Diff line number Diff line change @@ -71,15 +71,19 @@ class Instagram internal constructor(url: String) : Extractor(url) {
7171 private suspend fun getUserID (): String? = cookies?.let { _ ->
7272
7373 getUserName()?.let {
74- val response = HttpRequest (String .format(PROFILE_API , it), headers).getResponse()
75- if (! isAccessible(JSONObject (response))) {
76- onProgress(Result .Failed (Error .InvalidCookies ))
74+ val response = HttpRequest (String .format(PROFILE_API , it), headers).getResponse()?.toJSONObject() ? : run {
75+ clientRequestError()
7776 return null
7877 }
79- return response?.toJSONObject()?.getJSONObject( " graphql " )?.getJSONObject( " user " )?.getString( " id " ) ? : run {
78+ if ( response.toString() == " {} " ) {
8079 clientRequestError()
81- null
80+ return null
81+ }
82+ if (! isAccessible(response)) {
83+ onProgress(Result .Failed (Error .InvalidCookies ))
84+ return null
8285 }
86+ return response.getJSONObject(" graphql" )?.getJSONObject(" user" )?.getString(" id" )
8387 } ? : run {
8488 onProgress(Result .Failed (Error .InvalidUrl ))
8589 }
You can’t perform that action at this time.
0 commit comments