Skip to main content

Save Instagram content you have access to.

Project description

instagram-archiver

Python versions PyPI - Version GitHub tag (with filter) License GitHub commits since latest release (by SemVer including pre-releases) CodeQL QA Tests Coverage Status Dependabot Documentation Status mypy uv pytest Ruff Downloads Stargazers pre-commit Prettier

@Tatsh Buy Me A Coffee Libera.Chat Mastodon Follow Patreon

Save Instagram content you have access to.

Installation

pip install instagram-archiver

Usage

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.
  -d, --debug                     Enable debug output.
  -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.

The dedup log lives at <output_dir>/.log.db and is honoured across runs in 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

instagram_archiver-0.4.1.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

instagram_archiver-0.4.1-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file instagram_archiver-0.4.1.tar.gz.

File metadata

  • Download URL: instagram_archiver-0.4.1.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for instagram_archiver-0.4.1.tar.gz
Algorithm Hash digest
SHA256 d7476ccb1b597a147cfae7000dc94fa6f6112f499981dd195b3c5aa1da6368a0
MD5 4633667c8bcf068b4a70db6cf812d7a4
BLAKE2b-256 33ab9a172e407045ea35eb2c5e2607a9acc976cb6585cc43fcf79e65a3f06533

See more details on using hashes here.

Provenance

The following attestation bundles were made for instagram_archiver-0.4.1.tar.gz:

Publisher: publish.yml on Tatsh/instagram-archiver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file instagram_archiver-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for instagram_archiver-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18435ef4253350b9a95ba6b4af6d43218077815eab090241083a32328ad0449f
MD5 18418daf1e372b8ff359ef6d7be3a617
BLAKE2b-256 5e1d54d5ce38c43ac0e0307d383e3e3431485f2a821fedbcfee0824e5727cb37

See more details on using hashes here.

Provenance

The following attestation bundles were made for instagram_archiver-0.4.1-py3-none-any.whl:

Publisher: publish.yml on Tatsh/instagram-archiver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page