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 e31cfb38..0c9eed85 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/InstagramRipper.java @@ -113,10 +113,10 @@ public class InstagramRipper extends AbstractJSONRipper { imageURL = imageURL.replaceAll("scontent.cdninstagram.com/hphotos-", "igcdn-photos-d-a.akamaihd.net/hphotos-ak-"); imageURL = imageURL.replaceAll("s640x640/", ""); - // it appears ig now allows higher resolution images to be uploaded but are artifically cropping the images to - // 1080x1080 to preserve legacy support. the cropping string below isnt present on ig website and removing it - // displays the uncropped image. - imageURL = imageURL.replaceAll("c0.114.1080.1080/", ""); + // 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 + imageURL = imageURL.replaceAll("\\/c\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}", ""); imageURL = imageURL.replaceAll("\\?ig_cache_key.+$", ""); return imageURL;