Wednesday, January 25, 2017

Python script to harvest pictures from specific Instagram accounts.



As a Raspberry Pi owner I am always tinkering and trying to think of new things to do with it.

I had the idea to write a script to download all pictures from some of my favorite Instagram users.

I wanted it to...

1) Download from a simple list of multiple users
2) Download all pictures even on multiple pages.
3) Ensure that it's always downloading the high-res version of the image.
4) Stop downloading once it reaches an image it has already downloaded.
5) Send me a notification of what if any new downloads are available.

So I set out writing it and below is the results of my efforts.

It isn't pretty, I can't guarantee it won't crash, and if Instrgram tweak their code base too much the scraping will probably break but here it is in all it's glory, hopefully some other users might find it useful.

NOTE: this will only download from public Instagram accounts.

http://pastebin.com/1iMBqEgq