From 86f7c622131e3cae2f2a79dbbc70238c7960a2ac Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Tue, 7 Nov 2017 23:48:08 -0500 Subject: [PATCH] IG ripper no longer errors out on finish --- .../com/rarchives/ripme/ripper/rippers/InstagramRipper.java | 5 +++++ 1 file changed, 5 insertions(+) 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 93bdcf41..56730a10 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java @@ -141,6 +141,11 @@ public class InstagramRipper extends AbstractJSONRipper { JSONObject data = (JSONObject) datas.get(i); try { if (!data.getBoolean("is_video")) { + if (imageURLs.size() == 0) { + // We add this one item to the array because either wise + // the ripper will error out because we returned an empty array + imageURLs.add(data.getString("thumbnail_src")); + } addURLToDownload(new URL(getOriginalUrl(data.getString("thumbnail_src")))); } else { addURLToDownload(new URL(getVideoFromPage(data.getString("code"))));