GithubHelp home page GithubHelp logo

adrientoub / instagram-crawler Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 2.0 31 KB

Short Ruby scripts to download images and videos from Instagram by crawling users or hashtags

Ruby 100.00%
instagram crawler

instagram-crawler's Introduction

Instagram crawler

Description

A simple Ruby script to download the full content of an instagram account or recent and top posts of an hashtag.

It currently doesn't support downloading stories.

Compatibility

Tested on Ruby 2.5 but should work with previous versions. Tested on:

  • Windows 10 x64
  • Linux x64

Usage

Install Ruby on your computer and launch the following command:

ruby ./instagram_crawler.rb [USERNAME...] [#HASHTAG...]

ruby ./instagram_crawler.rb [--update] [--update-users] [--update-hashtags]

You can put any number of usernames and hashtags in any order.

It will download the content of the instagram account or hashtag to ./username/* or ./#hashtag/*. The files will be named by their instagram id followed by .jpg for images and .mp4 for videos. For instagram accounts it will also download the profile picture to ./username/profile.jpg.

You can use --update, --update-hashtags or --update-users to respectively update all downloaded users and hashtags, hashtags or users.

If you want to download private users you have access to, you can set the COOKIE environment variable to the complete value that is sent by your browser when you browse https://www.instagram.com.

Examples

On Bash to use it you can do:

./instagram_crawler.rb adrientoub '#ruby' microsoft '#bash'
# or
./instagram_crawler.rb adrientoub \#ruby microsoft \#bash
# or
./instagram_crawler.rb --update-users
# or
./instagram_crawler.rb --update

On Powershell to use it you can do:

ruby .\instagram_crawler.rb adrientoub "#ruby" microsoft "#powershell"
# or
ruby .\instagram_crawler.rb --update-users
# or
ruby .\instagram_crawler.rb --update

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.