Merge branch 'varaghar-master' (Merge 4pr0n/ripme#600, Fixes 4pr0n/ripme#598)

This commit is contained in:
metaprime 2017-10-12 02:25:34 -07:00
commit 81e442eb18

View File

@ -137,10 +137,17 @@ public class InstagramRipper extends AbstractJSONRipper {
private String getMedia(JSONObject data) {
String imageURL = "";
JSONObject mediaObject;
if (data.has("videos")) {
imageURL = data.getJSONObject("videos").getJSONObject("standard_resolution").getString("url");
mediaObject = data.getJSONObject("videos");
if (!mediaObject.isNull("standard_resolution")) {
imageURL = mediaObject.getJSONObject("standard_resolution").getString("url");
}
} else if (data.has("images")) {
imageURL = data.getJSONObject("images").getJSONObject("standard_resolution").getString("url");
mediaObject = data.getJSONObject("images");
if (!mediaObject.isNull("standard_resolution")) {
imageURL = mediaObject.getJSONObject("standard_resolution").getString("url");
}
}
return imageURL;
}