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 ab44edfd..e78834ba 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java @@ -127,11 +127,11 @@ public class InstagramRipper extends AbstractHTMLRipper { return m.group(1); } - p = Pattern.compile("^https?://www.instagram.com/explore/tags/([^/]+)/?"); - m = p.matcher(url.toExternalForm()); - if (m.matches()) { - return m.group(1); - } +// p = Pattern.compile("^https?://www.instagram.com/explore/tags/([^/]+)/?"); +// m = p.matcher(url.toExternalForm()); +// if (m.matches()) { +// return m.group(1); +// } throw new MalformedURLException("Unable to find user in " + url); } @@ -212,7 +212,8 @@ public class InstagramRipper extends AbstractHTMLRipper { JSONArray datas = new JSONArray(); try { JSONArray profilePage = json.getJSONObject("entry_data").getJSONArray("ProfilePage"); - datas = profilePage.getJSONObject(0).getJSONObject("user").getJSONObject("media").getJSONArray("nodes"); + datas = profilePage.getJSONObject(0).getJSONObject("graphql").getJSONObject("user") + .getJSONObject("edge_owner_to_timeline_media").getJSONArray("edges"); } catch (JSONException e) { // Handle hashtag pages datas = json.getJSONObject("entry_data").getJSONArray("TagPage").getJSONObject(0) @@ -220,15 +221,16 @@ public class InstagramRipper extends AbstractHTMLRipper { } for (int i = 0; i < datas.length(); i++) { JSONObject data = (JSONObject) datas.get(i); - Long epoch = data.getLong("date"); + data = data.getJSONObject("node"); + Long epoch = data.getLong("taken_at_timestamp"); Instant instant = Instant.ofEpochSecond(epoch); String image_date = DateTimeFormatter.ofPattern("yyyy_MM_dd_hh:mm_").format(ZonedDateTime.ofInstant(instant, ZoneOffset.UTC)); if (data.getString("__typename").equals("GraphSidecar")) { try { - Document slideShowDoc = Http.url(new URL ("https://www.instagram.com/p/" + data.getString("code"))).get(); + Document slideShowDoc = Http.url(new URL("https://www.instagram.com/p/" + data.getString("shortcode"))).get(); List toAdd = getPostsFromSinglePage(slideShowDoc); for (int slideShowInt=0; slideShowInt