This script allows you to download Instagram stories from any public account.
You can also automate the script to run at system startup, for example, every 2 hours using Task Scheduler.
The script operates in several steps:
-
Opening Web Browser: The script initiates a headless web browser session using Selenium WebDriver.
-
Navigating to Download Page: It directs the browser to the webpage, which facilitates content downloading from social media platforms.
-
Inputting Instagram Story URL: The user provides the URL of the Instagram story they wish to download.
-
Identifying and Downloading Media: The script identifies the type of media (images or videos) present in the story and proceeds to download them to the specified directory.
-
Recording Downloaded Links: To avoid redundant downloads, the script maintains a record of
downloaded_links.txt
. -
Recording Run Time: The script records the time of execution in the
task.txt
file, providing a log of script runs. -
Error Handling: The script includes error-handling mechanisms to deal with unexpected situations, ensuring smooth execution.
By following these steps, the script enables users to conveniently download Instagram stories for offline viewing.
-
Clone the repository:
git clone https://github.com/LupusJM/InstaDownloader.git
-
Install Dependencies:
pip install requests selenium urllib3
-
Configuration:
- Modify the
download_folder
variable to your target directory. You can right-click on the script, choose "Open With" and select Notepad. Then, change thedownload_folder
variable to point to your desired folder path. - Update the
instagram_stories_url
variable with the URL of the Instagram story you want to download.
- Modify the
-
Run the Script:
python main.py
-
Enjoy your files:
LupusDownloader_{username}_{download_date}_{index 1}.{extension}
- Automation with Task Scheduler: Optionally, you can automate the script to run at system startup or at regular intervals using Task Scheduler. This allows you to schedule the script to run, for example, every 2 hours for periodic updates.
- Tested and verified in Linux & Windows OS.
- This script requires the Google Chrome browser and its driver suitable for your operating system.
- Remember that downloading content from social media platforms may be restricted by copyright and Instagram's terms of service.