From 0c995f67f0796f56e6bbde33405adcf769942d01 Mon Sep 17 00:00:00 2001 From: "Jozsef.Kerekes" Date: Fri, 6 Oct 2017 21:04:28 +0300 Subject: [PATCH] Instagram: [standard_resolution] is not a JSONObject. Improvement after feedback --- .../com/rarchives/ripme/ripper/rippers/InstagramRipper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 8cac12ba..e81aa031 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java @@ -137,13 +137,14 @@ public class InstagramRipper extends AbstractJSONRipper { private String getMedia(JSONObject data) { String imageURL = ""; + JSONObject mediaObject; if (data.has("videos")) { - JSONObject videosObject = data.getJSONObject("videos"); + mediaObject = data.getJSONObject("videos"); if (!videosObject.isNull("standard_resolution")) { imageURL = videosObject.getJSONObject("standard_resolution").getString("url"); } } else if (data.has("images")) { - JSONObject imagesObject = data.getJSONObject("images"); + mediaObject = data.getJSONObject("images"); if (!imagesObject.isNull("standard_resolution")) { imageURL = imagesObject.getJSONObject("standard_resolution").getString("url"); }