From d0b61d8fb3b8108060649e49b8d5495de017c92b Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Mon, 18 Jun 2018 20:36:06 -0400 Subject: [PATCH] Fixed instagram ripper --- .../rarchives/ripme/ripper/rippers/InstagramRipper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java index 63a07e91..cb410fb3 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java @@ -246,11 +246,12 @@ public class InstagramRipper extends AbstractJSONRipper { 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 { @@ -391,8 +392,9 @@ public class InstagramRipper extends AbstractJSONRipper { } 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; }