IG ripper no longer errors out on finish

This commit is contained in:
cyian-1756 2017-11-07 23:48:08 -05:00
parent b5d09cdc97
commit 86f7c62213

View File

@ -141,6 +141,11 @@ public class InstagramRipper extends AbstractJSONRipper {
JSONObject data = (JSONObject) datas.get(i); JSONObject data = (JSONObject) datas.get(i);
try { try {
if (!data.getBoolean("is_video")) { 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")))); addURLToDownload(new URL(getOriginalUrl(data.getString("thumbnail_src"))));
} else { } else {
addURLToDownload(new URL(getVideoFromPage(data.getString("code")))); addURLToDownload(new URL(getVideoFromPage(data.getString("code"))));