Instagram ripper no longer throws JSONObject["end_cursor"] not a string when finishing a rip

This commit is contained in:
cyian-1756 2018-10-05 10:18:25 -04:00
parent 7e890bce2f
commit 46c4f2071e
1 changed files with 7 additions and 2 deletions

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 "";
}
}
}