Merge pull request #985 from cyian-1756/igFixes

Instagram ripper no longer throws JSONObject["end_cursor"] not a stri…
This commit is contained in:
cyian-1756 2018-10-06 08:56:37 -05:00 committed by GitHub
commit 4820a206b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,8 +224,13 @@ public class InstagramRipper extends AbstractJSONRipper {
.getJSONObject("graphql").getJSONObject("user")
.getJSONObject("edge_owner_to_timeline_media").getJSONObject("page_info").getString("end_cursor");
} catch (JSONException e) {
return json.getJSONObject("data").getJSONObject("user")
.getJSONObject("edge_owner_to_timeline_media").getJSONObject("page_info").getString("end_cursor");
// This is here so that when the user rips the last page they don't get a "end_cursor not a string" error
try {
return json.getJSONObject("data").getJSONObject("user")
.getJSONObject("edge_owner_to_timeline_media").getJSONObject("page_info").getString("end_cursor");
} catch (JSONException t) {
return "";
}
}
}