Fixed Instagram Ripper cropping issue

Merged 4pr0n/ripme#592
Fixes 4pr0n/ripme#541
This commit is contained in:
Luke Payne 2017-07-01 16:28:01 +09:30 committed by metaprime
parent cfab32d271
commit c37a7c351a

View File

@ -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("scontent.cdninstagram.com/hphotos-", "igcdn-photos-d-a.akamaihd.net/hphotos-ak-");
imageURL = imageURL.replaceAll("s640x640/", ""); imageURL = imageURL.replaceAll("s640x640/", "");
// it appears ig now allows higher resolution images to be uploaded but are artifically cropping the images to // Instagram returns cropped images to unauthenticated applications to maintain legacy support.
// 1080x1080 to preserve legacy support. the cropping string below isnt present on ig website and removing it // To retrieve the uncropped image, remove this segment from the URL.
// displays the uncropped image. // Segment format: cX.Y.W.H - eg: c0.134.1080.1080
imageURL = imageURL.replaceAll("c0.114.1080.1080/", ""); imageURL = imageURL.replaceAll("\\/c\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}", "");
imageURL = imageURL.replaceAll("\\?ig_cache_key.+$", ""); imageURL = imageURL.replaceAll("\\?ig_cache_key.+$", "");
return imageURL; return imageURL;