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:
commit
0fc3b1c14c
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user