This program is a program that can be used to retrieve data from Instagram and download their content
- Using requests instead of webdriver makes it lighter and faster
- use of cookies and check expiration so you don't need to always log in
- can download all content uploaded by users
- search for the target user ID automatically so that the user only needs to enter the target username
- providing an update_component file to make it easier for those who have difficulty using the flag command
- The download quality does not decrease and the quality will remain the same as the original quality of the post
- python-dotenv is a convenient Python library that simplifies the management of environment variables in your projects. It allows you to load variables from a .env file into your environment, making it easy to configure and control settings for your applications.
- icecream is a Python library that provides a simple and informative way to log code, helping with monitoring program execution flows.
- requests is an easy-to-use Python library for interacting with APIs and making HTTP requests.
- tqdm is a Python library that provides an aesthetic progress bar to monitor the execution process in iterations.
- Python v3.11.6+
- icecream v2.1.3+
- python-dotenv v1.0.0+
- requests v2.31.0+
- tqdm v4.66.1+
To run this program you need to install some libraries with the command
pip install -r requirements.txt
# Clone this repositories
git clone https://github.com/ryosoraa/InstaHarvest.git
# go into the directory
cd InstaHarvest
To run the program the first time you have to include several flags
python main.py --username target_username --cookies '<YOUR_COOKIES>' --igclaim '<YOUR-X-Ig-Www-Claim>' --path '<YOUR_PATH_TO_SAVE>'
or if you don't understand you can run the update_component.py file and insert COOKIES and X-Ig-Www-Claim there
python update_component.py
-
Log in to the Instagram account you want to use to retrieve data
-
If you are already logged in then continue by opening the target account profile
-
Open developer Tool Using Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux)
-
Open the network menu and run the shortcut CTRL + R to reload the page
-
look for the name that has: username/?count=12
-
Click and scroll down until you find Cookies and X-Ig-Www-Claim
-
Copy Cookies and X-Ig-Www-Claim to insert into the code above
Flag | Alias | Descriptions | Example |
---|---|---|---|
--username | -u | Insert username account target | --username freya.jkt48 |
--cookies | -c | Insert your cookies | --cookies 'sxdfcgvbhnj' |
--igclaim | -ic | Insert your X-Ig-Www-Claim | --igclaim 'dcfvgbhjnmk' |
--path | -p | Insert your PATH you want to save | --path 'data/content' |
│ .env
│ .gitignore
│ LICENSE
│ main.py
│ README.md
│ requirements.txt
│ update_component.py
│
├───data
└───src
│ __init__.py
│
├───exceptions
│ ExpiredExceptions.py
│ PathNotFoundExceptions.py
│
├───service
│ instagram.py
│
└───utils
Arguments.py
file.py
👤 Rio Dwi Saputra
- Twitter: @ryyo_cs
- Github: @ryyos
- LinkedIn: @rio-dwi-saputra-23560b287
- Instagram: @ryyo.cs