Packages and Binaries:

instaloader

Downloads public and private profiles, hashtags, user stories, feeds and saved media Downloads comments, geotags and captions of each post. Automatically detects profile name changes and renames the target directory accordingly Allows fine-grained customization of filters and where to store downloaded media

Installed size: 405 KB
How to install: sudo apt install instaloader

  • python3
  • python3-requests
instaloader
root@kali:~# instaloader -h
usage: 
instaloader.py [--comments] [--geotags]
               [--stories] [--highlights] [--tagged] [--igtv]
               [--login YOUR-USERNAME] [--fast-update]
               profile | "#hashtag" | %location_id | :stories | :feed | :saved
instaloader.py --help

Download pictures (or videos) along with their captions and other metadata
from Instagram.

What to Download:
  Specify a list of targets. For each of these, Instaloader creates a folder
  and downloads all posts. The following targets are supported:

  profile               Download profile. If an already-downloaded profile has
                        been renamed, Instaloader automatically finds it by
                        its unique ID and renames the folder likewise.
  @profile              Download all followees of profile. Requires --login.
                        Consider using :feed rather than @yourself.
  "#hashtag"            Download #hashtag.
  %location_id          Download %location_id. Requires --login.
  :feed                 Download pictures from your feed. Requires --login.
  :stories              Download the stories of your followees. Requires
                        --login.
  :saved                Download the posts that you marked as saved. Requires
                        --login.
  -- -shortcode         Download the post with the given shortcode
  filename.json[.xz]    Re-Download the given object.
  +args.txt             Read targets (and options) from given textfile.

What to Download of each Post:
  --no-pictures         Do not download post pictures. Cannot be used together
                        with --fast-update. Implies --no-video-thumbnails,
                        does not imply --no-videos.
  -V, --no-videos       Do not download videos.
  --no-video-thumbnails
                        Do not download thumbnails of videos.
  -G, --geotags         Download geotags when available. Geotags are stored as
                        a text file with the location's name and a Google Maps
                        link. This requires an additional request to the
                        Instagram server for each picture. Requires --login.
  -C, --comments        Download and update comments for each post. This
                        requires an additional request to the Instagram server
                        for each post, which is why it is disabled by default.
  --no-captions         Do not create txt files.
  --post-metadata-txt POST_METADATA_TXT
                        Template to write in txt file for each Post.
  --storyitem-metadata-txt STORYITEM_METADATA_TXT
                        Template to write in txt file for each StoryItem.
  --no-metadata-json    Do not create a JSON file containing the metadata of
                        each post.
  --no-compress-json    Do not xz compress JSON files, rather create pretty
                        formatted JSONs.

What to Download of each Profile:
  --no-posts            Do not download regular posts.
  --no-profile-pic      Do not download profile picture.
  -s, --stories         Also download stories of each profile that is
                        downloaded. Requires --login.
  --highlights          Also download highlights of each profile that is
                        downloaded. Requires --login.
  --tagged              Also download posts where each profile is tagged.
  --igtv                Also download IGTV videos.

Which Posts to Download:
  -F, --fast-update     For each target, stop when encountering the first
                        already-downloaded picture. This flag is recommended
                        when you use Instaloader to update your personal
                        Instagram archive.
  --post-filter filter, --only-if filter
                        Expression that, if given, must evaluate to True for
                        each post to be downloaded. Must be a syntactically
                        valid python expression. Variables are evaluated to
                        instaloader.Post attributes. Example: --post-
                        filter=viewer_has_liked.
  --storyitem-filter filter
                        Expression that, if given, must evaluate to True for
                        each storyitem to be downloaded. Must be a
                        syntactically valid python expression. Variables are
                        evaluated to instaloader.StoryItem attributes.
  -c COUNT, --count COUNT
                        Do not attempt to download more than COUNT posts.
                        Applies only to #hashtag and :feed.

Login (Download Private Profiles):
  Instaloader can login to Instagram. This allows downloading private
  profiles. To login, pass the --login option. Your session cookie (not your
  password!) will be saved to a local file to be reused next time you want
  Instaloader to login.

  -l YOUR-USERNAME, --login YOUR-USERNAME
                        Login name (profile name) for your Instagram account.
  -f SESSIONFILE, --sessionfile SESSIONFILE
                        Path for loading and storing session key file.
                        Defaults to
                        /root/.config/instaloader/session-<login_name>
  -p YOUR-PASSWORD, --password YOUR-PASSWORD
                        Password for your Instagram account. Without this
                        option, you'll be prompted for your password
                        interactively if there is not yet a valid session
                        file.

How to Download:
  --dirname-pattern DIRNAME_PATTERN
                        Name of directory where to store posts. {profile} is
                        replaced by the profile name, {target} is replaced by
                        the target you specified, i.e. either :feed, #hashtag
                        or the profile name. Defaults to '{target}'.
  --filename-pattern FILENAME_PATTERN
                        Prefix of filenames, relative to the directory given
                        with --dirname-pattern. {profile} is replaced by the
                        profile name,{target} is replaced by the target you
                        specified, i.e. either :feed#hashtag or the profile
                        name. Defaults to '{date_utc}_UTC'
  --user-agent USER_AGENT
                        User Agent to use for HTTP requests. Defaults to
                        'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
                        (KHTML, like Gecko) Chrome/51.0.2704.79
                        Safari/537.36'.
  --max-connection-attempts N
                        Maximum number of connection attempts until a request
                        is aborted. Defaults to 3. If a connection fails, it
                        can be manually skipped by hitting CTRL+C. Set this to
                        0 to retry infinitely.
  --commit-mode         Tries to ensure downloaded images avoid corruption in
                        case of unexpected interruption. If the last picture
                        is corrupted, Instaloader will fix the picture the
                        next time it is run. Requires the JSON metadata to be
                        saved.
  --request-timeout N   seconds to wait before timing out a connection request

Miscellaneous Options:
  -q, --quiet           Disable user interaction, i.e. do not print messages
                        (except errors) and fail if login credentials are
                        needed but not given. This makes Instaloader suitable
                        as a cron job.
  -h, --help            Show this help message and exit.
  --version             Show version number and exit.

Report issues at https://github.com/instaloader/instaloader/issues. The
complete documentation can be found at https://instaloader.github.io/.

Updated on: 2021-Nov-26