A fast and lightweight Instagram media downloader.
instascrape is a fast and lightweight utility and Python library for downloading a massive amount of media (photos and videos) from Instagram, without using the official Instagram Public API.
What makes instascrape special, is that instascrape aims at high efficeiency and speed. It provides a preload option that fetches and loads the full data of every item (Post/Profile) beforehand, using multithreading with the producer-consumer strategy.
- π Powerful & simple-to-use library interface
- β calls methods in a chain (fluent interface)
- π© provides hooks/callbacks in download methods
- πΈ User-friendly commad-line interface
- π¨ High efficiency
- 𧡠uses multithreading to fetch data
- β‘οΈ uses generators to yield results
- π Provides a filter option to avoid downloading media that you don't want
- π Download media along with their metadata
β οΈ Good exceptions handling- πͺ Manages multiple cookies for you
- π Peforms authentication effectively
- π supports 2FA
- π solves checkpoint challenge
- πΆ Can be used in anonymous mode
βΈ Please make sure you have Python 3.5+ installed in your machine.
- requests (https://github.com/requests/requests)
- tqdm (https://github.com/tqdm/tqdm)
- colorama (https://github.com/tartley/colorama)
$ pip install instascraper
NOTE: Be careful when installing! The project name on PyPI is
instascraper
, notinstascrape
, since the nameinstascrape
has been taken by another project.
$ git clone https://github.com/tnychn/instascrape.git
$ cd instascrape
$ python setup.py install
To quickly download 100 timeline posts of Emma Watson (@emmawatson) that have more than 1M likes,
$ instascrape down @emmawatson -timeline -PF "likes_count >= 1000000" -l 100 --preload -d ~/Pictures/Instagram
from instascrape import Instascraper
with Instascraper() as insta:
posts = insta.profile("emmawatson").timeline_posts()
posts.limit(100).preload(True).filter(lambda p: p.likes_count >= 1000000)
posts.download_all(dest="/Users/user/Pictures/Instagram")
This project is in no way authorized, maintained or sponsored by Instagram. Use instascrape responsibly, do not use it for spamming or illegal activities.
We are not responsible for any kinds of negative actions that results from the use of instascrape. This is an independent and unofficial project. Use at your own risk.
MIT Β© 2019 Tony Chan