Fix style
This commit is contained in:
parent
0c995f67f0
commit
f8be5f2d74
@ -137,17 +137,17 @@ public class InstagramRipper extends AbstractJSONRipper {
|
|||||||
|
|
||||||
private String getMedia(JSONObject data) {
|
private String getMedia(JSONObject data) {
|
||||||
String imageURL = "";
|
String imageURL = "";
|
||||||
JSONObject mediaObject;
|
JSONObject mediaObject;
|
||||||
if (data.has("videos")) {
|
if (data.has("videos")) {
|
||||||
mediaObject = data.getJSONObject("videos");
|
mediaObject = data.getJSONObject("videos");
|
||||||
if (!videosObject.isNull("standard_resolution")) {
|
if (!mediaObject.isNull("standard_resolution")) {
|
||||||
imageURL = videosObject.getJSONObject("standard_resolution").getString("url");
|
imageURL = mediaObject.getJSONObject("standard_resolution").getString("url");
|
||||||
}
|
}
|
||||||
} else if (data.has("images")) {
|
} else if (data.has("images")) {
|
||||||
mediaObject = data.getJSONObject("images");
|
mediaObject = data.getJSONObject("images");
|
||||||
if (!imagesObject.isNull("standard_resolution")) {
|
if (!mediaObject.isNull("standard_resolution")) {
|
||||||
imageURL = imagesObject.getJSONObject("standard_resolution").getString("url");
|
imageURL = mediaObject.getJSONObject("standard_resolution").getString("url");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return imageURL;
|
return imageURL;
|
||||||
}
|
}
|
||||||
@ -165,14 +165,14 @@ public class InstagramRipper extends AbstractJSONRipper {
|
|||||||
for (int carouselIndex = 0; carouselIndex < carouselMedias.length(); carouselIndex++) {
|
for (int carouselIndex = 0; carouselIndex < carouselMedias.length(); carouselIndex++) {
|
||||||
JSONObject carouselMedia = (JSONObject) carouselMedias.get(carouselIndex);
|
JSONObject carouselMedia = (JSONObject) carouselMedias.get(carouselIndex);
|
||||||
String imageURL = getMedia(carouselMedia);
|
String imageURL = getMedia(carouselMedia);
|
||||||
if (!"".equals(imageURL)) {
|
if (!imageURL.equals("")) {
|
||||||
imageURL = getOriginalUrl(imageURL);
|
imageURL = getOriginalUrl(imageURL);
|
||||||
imageURLs.add(imageURL);
|
imageURLs.add(imageURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String imageURL = getMedia(data);
|
String imageURL = getMedia(data);
|
||||||
if (!"".equals(imageURL)) {
|
if (!imageURL.equals("")) {
|
||||||
imageURL = getOriginalUrl(imageURL);
|
imageURL = getOriginalUrl(imageURL);
|
||||||
imageURLs.add(imageURL);
|
imageURLs.add(imageURL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user