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
- Add a session cookie
basketcase --cookie <session_cookie_id> --cookie-name "my session cookie"
# Added session id: 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
cd
to the project root and create a virtual environment in a directory namedvenv
, which is conveniently ignored in version control.- Install the dependencies.
pip install -r requirements.txt
- Install this package in editable mode.
pip install -e .
Package build and upload
- Update the requirements list.
pip freeze --exclude-editable > requirements.txt
- Increment the version on
pyproject.toml
. - Build the package.
hatch build
- Commit and push the changes (and a new version tag) to the git repository.
- Publish it.
hatch publish
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 860d14474d474730e2c79e0d0c1a8816717168e8398e96522942f6f32be51f06 |
|
MD5 | a79841e1bb32d392dc02bb44f2741cfe |
|
BLAKE2b-256 | 71987569252a79895586c475a59ce3eea2886656c6a3b7bb87b7aad0989e77dd |
File details
Details for the file basketcase-4.0.0-py3-none-any.whl
.
File metadata
- Download URL: basketcase-4.0.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a05d51bcbbf2af1ab387b556c21d9771d6692e98459727fd2780c24707fb5982 |
|
MD5 | 33949a36c99ba67d3e017e1bb236a77e |
|
BLAKE2b-256 | 991d788bf8a59093b5f4735057fe0d3386d9e1329036d1f61ebadd9e4e1c9f89 |