iaman1998 / instascrape

πŸš€ A fast and lightweight utility and Python library for downloading posts, stories, and highlights from Instagram.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logo

instascrape

A fast and lightweight Instagram media downloader.

demo
Downloading 50 timeline posts and tagged posts (excluding videos) with preload option enabled, within 60 seconds.

github releases pypi project pypi downloads license


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.

Features

  • πŸ”Œ 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

Prerequisites

β–Έ Please make sure you have Python 3.5+ installed in your machine.

Dependencies

Installation

Lastest PyPI Stable Release (Recommended)

$ pip install instascraper

NOTE: Be careful when installing! The project name on PyPI is instascraper, not instascrape, since the name instascrape has been taken by another project.

Latest GitHub Commit

$ git clone https://github.com/tnychn/instascrape.git
$ cd instascrape
$ python setup.py install

Quickstart

To quickly download 100 timeline posts of Emma Watson (@emmawatson) that have more than 1M likes,

Command-line

$ instascrape down @emmawatson -timeline -PF "likes_count >= 1000000" -l 100 --preload -d ~/Pictures/Instagram

Library

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")

Disclaimer

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.


~ crafted with β™₯︎ by tnychn ~
MIT Β© 2019 Tony Chan

About

πŸš€ A fast and lightweight utility and Python library for downloading posts, stories, and highlights from Instagram.

License:MIT License


Languages

Language:Python 100.0%