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

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.0.tar.gz (37.8 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.0-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: instagram_archiver-0.4.0.tar.gz
  • Upload date:
  • Size: 37.8 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.0.tar.gz
Algorithm Hash digest
SHA256 aeb8dba22028fcf66492bb304fe672c3c6261d658f3785437b8f8670d3b12abd
MD5 47053e27a78126669c63154737d64c62
BLAKE2b-256 eb18a440d77bb9d4fe0d41babcd820a98abab2011ddfcaeaac448042d8f7a654

See more details on using hashes here.

Provenance

The following attestation bundles were made for instagram_archiver-0.4.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for instagram_archiver-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34ed2606e50ae357cdca016cadc167381bb49d7af6a8c5ed6d7c4710a67c8d0f
MD5 37ad0c30fb5d8f6fa9e0a8945667e6da
BLAKE2b-256 5a683550b5ff01c7f8d12fafbf474f823e5f6ca740ee3632b76fce2c4a0ae595

See more details on using hashes here.

Provenance

The following attestation bundles were made for instagram_archiver-0.4.0-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