Instagram Images NOT being downloaded. - WeOnlyDo Discussion board

Instagram Images NOT being downloaded. (wodHttpDLX)

by ihutee, Monday, October 12, 2015, 17:34 (3330 days ago)

I made a simple instagram image scraper.

I'm having an issue though.

Example: https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s640x640/sh0.08/e35/11372375...

1. When I visit the image link using a .get with the SAME headers the file does not download complete.
2. If I go check the wodhttp temp file, the image has downloaded 100% correctly but for some reason when it is in http(index).response.body, it replaces image characters with QUESTION marks leaving the image corrupted.

Really having issues here.

is WODHTTP able to visit and properly retreive the correct response of the image in .response.body?

Instagram Images NOT being downloaded.

by Jasmine, Monday, October 12, 2015, 17:40 (3330 days ago) @ ihutee

Hi Ihutee.

You're seeing question marks due to encoding that is used when binary data is converted to string. However, when dealing with binary data, you should not even access Response.Body. Rather, access it through Response.Filename to access raw file, and then copy or reference directly.

You can even set up your own Response.Filename to point to a file where it suits you, from within HeadersDone event.

I hope this helps!
Jasmine.

Instagram Images NOT being downloaded.

by ihutee, Tuesday, October 13, 2015, 00:16 (3330 days ago) @ Jasmine

Won't setting the response.filename always use that filename then?

Won't it constantly over-write? or should I be setting a new response.filename with each new image?

Also would if i went to a html file to gather the data, wouldn't that also save it to that file?

Essentially I need to change it everytime?

Instagram Images NOT being downloaded.

by Jasmine, Tuesday, October 13, 2015, 00:18 (3330 days ago) @ ihutee

Hi.

Response is recreated on each new GET/POST calling, so if you leave it alone, default (temp) file is used.

But it's up to you to decide. If you're fetching image, it's wise to set it upfront.

Or you can leave it default and copy it later.

Jasmine.