Skip to content

Commit

Permalink
Merge pull request #716 from cyian-1756/igFix
Browse files Browse the repository at this point in the history
Fixed instagram ripper
  • Loading branch information
cyian-1756 authored Jun 19, 2018
2 parents 08f4c3e + d0b61d8 commit 0daec63
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,12 @@ public List<String> getURLsFromJSON(JSONObject json) {
try {
JSONArray profilePage = json.getJSONObject("entry_data").getJSONArray("ProfilePage");
userID = profilePage.getJSONObject(0).getString("logging_page_id").replaceAll("profilePage_", "");
datas = profilePage.getJSONObject(0).getJSONObject("graphql").getJSONObject("user")
datas = json.getJSONObject("entry_data").getJSONArray("ProfilePage").getJSONObject(0)
.getJSONObject("graphql").getJSONObject("user")
.getJSONObject("edge_owner_to_timeline_media").getJSONArray("edges");
} catch (JSONException e) {
datas = json.getJSONObject("data").getJSONObject("user")
.getJSONObject("edge_owner_to_timeline_media").getJSONArray("edges");
.getJSONObject("edge_user_to_photos_of_you").getJSONArray("edges");
}
} else {
try {
Expand Down Expand Up @@ -391,8 +392,9 @@ public void downloadURL(URL url, int index) {
}

private boolean pageHasImages(JSONObject json) {
LOGGER.info(json);
int numberOfImages = json.getJSONObject("data").getJSONObject("user")
.getJSONObject("edge_owner_to_timeline_media").getJSONArray("edges").length();
.getJSONObject("edge_user_to_photos_of_you").getJSONArray("edges").length();
if (numberOfImages == 0) {
return false;
}
Expand Down

0 comments on commit 0daec63

Please sign in to comment.