instagram-archiver
Save Instagram content you have access to.
Installation
pip install instagram-archiverUsage
Usage: instagram-archiver [OPTIONS] [USERNAME]
Archive a profile (USERNAME) or your saved posts (--saved).
Pass exactly one of: a USERNAME positional argument, or --saved/-s.
Options:
-o, --output-dir DIRECTORY Output directory. Defaults to the username
(profile mode) or `.` (saved mode).
-b, --browser [brave|chrome|chromium|edge|opera|vivaldi|firefox|safari]
Browser to read cookies from.
-p, --profile TEXT Browser profile.-q, --quiet Disable progress display updates. -S, --sleep-time INTEGER Number of seconds yt-dlp waits between requests. --no-log Ignore log (re-fetch everything). -C, --include-comments Also download all comments (extends download time significantly). -R, --include-child-comments Also recursively download child (reply) comments. Implies --include-comments. -s, --saved Archive your saved posts instead of a profile (mutually exclusive with USERNAME). -u, --unsave Unsave posts after successful archive (only with --saved). -h, --help Show this message and exit.
Typical use:
instagram-archiver -o ~/instagram-backups/username username instagram-archiver --saved -o ~/instagram-backups/saved
When neither `--debug` nor `--quiet` is passed, a Rich-based live progress
display (provided by the `archiver-stats` library) is shown on stderr. Pass
`--quiet` to disable it for non-interactive use, or `--debug` to see verbose
log output instead.
Downloads run concurrently using `niquests.AsyncSession` and
producer/consumer queues: one worker for media posts, one for comments
(when `-C` is passed), and one for yt-dlp video downloads. Each worker
handles at most one in-flight HTTP request at a time, which keeps Instagram
rate-limiting at bay while still overlapping image downloads with yt-dlp.
both profile and --saved modes. Pass --no-log to bypass it and re-fetch everything.
Notes
The default output path is the username under the current working directory.
Videos are saved using yt-dlp and its respective configuration.
In profile mode, both image and video items in the user's highlights and currently-active stories are archived. Image story items go through the same media pipeline as posts, while video items are handed to yt-dlp.