Merge pull request #274 from cyian-1756/ig_useraccount_slide_show

Instagram ripper now downloads slide shows when ripping user profiles
This commit is contained in:
cyian-1756 2017-11-27 17:26:46 -05:00 committed by GitHub
commit 0fc3b1c14c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,7 +212,19 @@ public class InstagramRipper extends AbstractHTMLRipper {
Long epoch = data.getLong("date");
Instant instant = Instant.ofEpochSecond(epoch);
String image_date = DateTimeFormatter.ofPattern("yyyy_MM_dd_hh:mm_").format(ZonedDateTime.ofInstant(instant, ZoneOffset.UTC));
if (data.getString("__typename").equals("GraphSidecar")) {
try {
Document slideShowDoc = Http.url(new URL ("https://www.instagram.com/p/" + data.getString("code"))).get();
List<String> toAdd = getPostsFromSinglePage(slideShowDoc);
for (int slideShowInt=0; slideShowInt<toAdd.size(); slideShowInt++) {
addURLToDownload(new URL(toAdd.get(slideShowInt)), image_date + data.getString("code"));
}
} catch (MalformedURLException e) {
logger.error("Unable to download slide show, URL was malformed");
} catch (IOException e) {
logger.error("Unable to download slide show");
}
}
try {
if (!data.getBoolean("is_video")) {
if (imageURLs.size() == 0) {