Skip to main content

Download images and videos from Instagram

Project description

BasketCase

Download images and videos from Instagram.

Installation

Install it from PyPI.

pip install basketcase

This will put the executable basketcase on your PATH.

Usage

basketcase -u "https://instagram.com/p/<post_id>"

Downloaded resources will be stored in the current working directory (i.e. $PWD/basketcase_{timestamp}/).

To download from multiple URLs, create a text file (e.g. basketcase.txt) and populate it with resource URLs

https://instagram.com/p/<post_id>
https://instagram.com/reel/<reel_id>
https://instagram.com/<username>
basketcase -f ./basketcase.txt

Supported URLs

Supported URL Description
https://instagram.com/<username> User profile. Downloads stories from the past 24 hours.
https://instagram.com/p/<post_id> Standard publication.
https://instagram.com/reel/<reel_id> Reels movie
https://www.instagram.com/stories/highlights/<highlight_id>/ A collection of stories, or "highlights"
https://www.instagram.com/s/<random_characters> A shorter type of URL

Authentication

  1. Add a session cookie
basketcase --cookie <session_cookie_id> --cookie-name "my session cookie"
# Added session id: 1
  1. Specify its identifier when downloading
basketcase -s 1

List all available sessions with basketcase -l

User data

Cookies and other application data are kept in ~/.basketcase.

Development setup

  1. cd to the project root and create a virtual environment in a directory named venv, which is conveniently ignored in version control.
  2. Install the dependencies.
pip install -r requirements.txt
  1. Install this package in editable mode.
pip install -e .

Package build and upload

  1. Update the requirements list.
pip freeze --exclude-editable > requirements.txt
  1. Increment the version on pyproject.toml.
  2. Build the package.
hatch build
  1. Commit and push the changes (and a new version tag) to the git repository.
  2. Publish it.
hatch publish

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

basketcase-4.0.0.tar.gz (86.4 kB view details)

Uploaded Source

Built Distribution

basketcase-4.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file basketcase-4.0.0.tar.gz.

File metadata

  • Download URL: basketcase-4.0.0.tar.gz
  • Upload date:
  • Size: 86.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for basketcase-4.0.0.tar.gz
Algorithm Hash digest
SHA256 860d14474d474730e2c79e0d0c1a8816717168e8398e96522942f6f32be51f06
MD5 a79841e1bb32d392dc02bb44f2741cfe
BLAKE2b-256 71987569252a79895586c475a59ce3eea2886656c6a3b7bb87b7aad0989e77dd

See more details on using hashes here.

File details

Details for the file basketcase-4.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for basketcase-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a05d51bcbbf2af1ab387b556c21d9771d6692e98459727fd2780c24707fb5982
MD5 33949a36c99ba67d3e017e1bb236a77e
BLAKE2b-256 991d788bf8a59093b5f4735057fe0d3386d9e1329036d1f61ebadd9e4e1c9f89

See more details on using hashes here.

Supported by

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