Download images and videos from Instagram
Project description
BasketCase
Download images and videos from Instagram.
Notable features:
- Stories can be downloaded without triggering the "seen" flag.
- Downloads a high quality version of a profile picture.
https://www.youtube.com/watch?v=NUTGr5t3MoY ;)
Installation
Install it from PyPI.
pip install --user basketcase
This should put the executable
basketcase
on your PATH.
Command-line usage
basketcase -u "https://instagram.com/p/<post_id>"
Downloaded resources will be stored in the current working directory (i.e.
$PWD/basketcase_downloads
).
To download from multiple URLs, create a text file (e.g. urls.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 ./urls.txt
Supported URLs
Supported URL | Description |
---|---|
https://instagram.com/<username> |
User profile. Downloads stories from the past 24 hours, and the profile picture. |
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"
# Added session id: 1
- Specify its identifier when downloading
basketcase -s 1
List all available sessions with
basketcase -l
. To disable sessions, use--no-session
. If only one exists, it is treated as the default.
User data
Cookies and other application data are kept in your home directory (i.e. ~/.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.
python -m build
- Commit and push the changes (and a new version tag) to the git repository.
- Publish it.
python -m twine upload dist/*
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
Built Distribution
File details
Details for the file basketcase-6.0.0.tar.gz
.
File metadata
- Download URL: basketcase-6.0.0.tar.gz
- Upload date:
- Size: 45.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8136a13a077527ade23c55f90042b40c7f07fb4f5ec7ab064032b53a4db6805 |
|
MD5 | 2f1b23e5e397b48c4839596dbf119ff7 |
|
BLAKE2b-256 | 28adceedb28e485a97dc609f93d030d82a1fc45811a5437e68d25c4b819f72a4 |
File details
Details for the file basketcase-6.0.0-py3-none-any.whl
.
File metadata
- Download URL: basketcase-6.0.0-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12e45249bc1c36356a5dfc07e77bf6f03551295d4eefe2f481d885cdd219306d |
|
MD5 | dbea9bfd48b1fdd84d059fa9e238ec7e |
|
BLAKE2b-256 | 59e982facb5c48757b7732a45db6bb20b68f65012c179b0003a389a3053687cf |