dannyvassallo / insta_scrape

The instagram swiss army knife. Restores all deprecated hashtag functionality and grants public api access from instagram's front end without any of the authorization.
https://rubygems.org/gems/insta_scrape
MIT License
60 stars 27 forks source link

Non standard image sizes #12

Closed brandons closed 7 years ago

brandons commented 7 years ago

insta_scrape will always return a url to an image that is square since these URLs come from Instagram's grid view. Most of the time this is acceptable except if the user decides to upload an image that is not the standard size. In this case the grid version crops the edges off the image.

Example: Original image: https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/p480x480/16465323_259532871141640_7137122661011816448_n.jpg?ig_cache_key=MTQ0NjcxMjQyNTU1MDQ5NDQ4Mw%3D%3D.2

Image returned by insta_scrape: https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/c0.45.638.638/16465323_259532871141640_7137122661011816448_n.jpg?ig_cache_key=MTQ0NjcxMjQyNTU1MDQ5NDQ4Mw%3D%3D.2.c

This creates a problem for the app I'm working on because a lot of the images I need have text embedded.

Is it possible to grab the full size image URL from the HTML? If not, do you know if there's an easy way to modify the grid image URL to get the original version?

I'm still learning Ruby, but if you point me in the right direction I can try to find a solution and submit a PR.

Thanks so much! :)

dannyvassallo commented 7 years ago

@brandons Hey -- I'll look into this when I can. If you look in the source, it's just using the same technologies you would use for BDD (Capybara / Poltergeist) so you can query instagram's dom. Take a look at the additional_meta methods and see if you you can figure something out from there -- I'm thinking you may need to open the link and that's what's happening in there.

I'll try and get to this when I'm not as busy : )

dannyvassallo commented 7 years ago

@brandons looking into this now -- preparing a new release.

dannyvassallo commented 7 years ago

@brandons this is in the new release 1.1.3