From 00a87f74d96d93aa52af9defa9992274e40a0510 Mon Sep 17 00:00:00 2001 From: ULBAZOR Date: Mon, 18 Sep 2017 05:21:16 +0200 Subject: [PATCH] Update InstagramRipper.java These changes to the getOriginalUrl should make sure that the InstagramRipper stops retrieving the cropped versions of the images. --- .../ripme/ripper/rippers/InstagramRipper.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 0c9eed85..0be42535 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java @@ -111,8 +111,21 @@ public class InstagramRipper extends AbstractJSONRipper { private String getOriginalUrl(String imageURL) { imageURL = imageURL.replaceAll("scontent.cdninstagram.com/hphotos-", "igcdn-photos-d-a.akamaihd.net/hphotos-ak-"); + imageURL = imageURL.replaceAll("p150x150/", ""); + imageURL = imageURL.replaceAll("p320x320/", ""); + imageURL = imageURL.replaceAll("p480x480/", ""); + imageURL = imageURL.replaceAll("p640x640/", ""); + imageURL = imageURL.replaceAll("p720x720/", ""); + imageURL = imageURL.replaceAll("p1080x1080/", ""); + imageURL = imageURL.replaceAll("p2048x2048/", ""); + imageURL = imageURL.replaceAll("s150x150/", ""); + imageURL = imageURL.replaceAll("s320x320/", ""); + imageURL = imageURL.replaceAll("s480x480/", ""); imageURL = imageURL.replaceAll("s640x640/", ""); - + imageURL = imageURL.replaceAll("s720x720/", ""); + imageURL = imageURL.replaceAll("s1080x1080/", ""); + imageURL = imageURL.replaceAll("s2048x2048/", ""); + // Instagram returns cropped images to unauthenticated applications to maintain legacy support. // To retrieve the uncropped image, remove this segment from the URL. // Segment format: cX.Y.W.H - eg: c0.134.1080.1080