i2yt is a powerful and highly customizable automation tool designed to streamline your content workflow. It scrapes Instagram Reels, intelligently organizes the data in Google Sheets, and can automatically upload the videos to Google Drive, preparing them for your YouTube channel or other content pipelines.
- Multi-Account Scraping: Effortlessly scrape Reels from multiple Instagram accounts with parallel processing
- Smart Data Management: Automatically saves data to Google Sheets with duplicate checks, status tracking, and clean formatting
- Google Drive Integration: Seamlessly download and upload Reels to Google Drive with automated file management
- Professional Parallel Processing: Leverages concurrent processing for maximum speed in scraping, description extraction, and uploads
- Multiple Execution Methods: Run via Python CLI, PowerShell interactive menu, or Windows batch launcher
- Highly Customizable: Fine-tune the entire workflow through a comprehensive
config.py
file with 50+ settings - Resilient & Robust: Built-in error handling, retry mechanisms, and intelligent rate limiting
- Workflow Automation Ready: Designed for integration with n8n, Task Scheduler, or other automation platforms
- Advanced Browser Management: Headless mode, session persistence, and optimized Chrome profile handling
- Comprehensive Logging: Detailed logging system with multiple verbosity levels and structured output
- Modular Architecture: Separate modules for scraping, description extraction, and Google Drive uploads
- Professional Status Tracking: Color-coded status system in Google Sheets with workflow state management
The automation process follows these steps:
- Scrape Reels: The tool scrapes the latest Reels from the specified Instagram accounts.
- Populate Google Sheets: New Reel URLs, along with metadata like username and Reel ID, are added to a Google Sheet. Duplicates are automatically skipped.
- Extract Descriptions: (Optional) The description for each Reel is extracted and added to the sheet.
- Upload to Google Drive: (Optional) The videos are downloaded and uploaded to your Google Drive.
- Update Status: The status of each Reel is updated in the Google Sheet, giving you a clear overview of the workflow (
pending
,processing
,completed
,failed
).
- Python 3.8+
- Google Chrome or Chromium
- A Google Cloud project with the Google Sheets and Google Drive APIs enabled.
- An Instagram account (for authentication to extract descriptions).
git clone https://github.com/your-username/i2yt.git
cd i2yt
pip install -r requirements.txt
For quick setup, use the automated setup script:
python setup.py
This script will:
- Install all Python dependencies
- Create
config.py
from the template - Check Chrome WebDriver availability
- Display next steps with clear instructions
If you prefer manual setup or need to understand each step:
You'''ll need to set up a Google Service Account to allow the application to access your Google Sheet and Google Drive.
- Follow the official Google Cloud documentation to create a service account and download the
credentials.json
file. - Place the
credentials.json
file in the root directory of the project. - Share your Google Sheet with the service account email address (Editor permissions).
- Use a Google Workspace Shared Drive (add service account as Content Manager)
- Share a personal folder with the service account (Editor permissions)
- See detailed setup guide for complete instructions
Copy the template to create your own configuration file:
copy config_template.py config.py
Now, open config.py
and customize it with your details:
INSTAGRAM_URLS
: A list of Instagram accounts to scrape.GOOGLE_SHEETS_ID
: The ID of your Google Sheet (from its URL).UPLOAD_TO_GOOGLE_DRIVE
: Set toTrue
to enable uploads.DRIVE_FOLDER_ID
: The ID of the Google Drive folder for uploads.
You can run the scraper in multiple ways:
python run_scraper.py
.\run_scraper.ps1
For Windows users, a convenient batch file launcher is provided:
-
Open
Launch_Instagram_Scraper.bat
in a text editor -
Find this line:
start wt -p "PowerShell" --title "Instagram Reel Scraper" pwsh -NoExit -ExecutionPolicy Bypass -File "d:\Kodo\i2yt\run_scraper.ps1"
-
Replace
"d:\Kodo\i2yt\run_scraper.ps1"
with the full path to your project directoryExample: If your project is in
C:\Users\YourName\Documents\i2yt\
, change it to:start wt -p "PowerShell" --title "Instagram Reel Scraper" pwsh -NoExit -ExecutionPolicy Bypass -File "C:\Users\YourName\Documents\i2yt\run_scraper.ps1"
-
Save the file and double-click to run
Features of the Batch Launcher:
- Opens a new Windows Terminal with PowerShell
- Sets the correct working directory automatically
- Runs with bypass execution policy
- Can be launched from anywhere (desktop, taskbar, etc.)
- Keeps the terminal open so you can see the results
- Provides an interactive menu for different operations
π For detailed information on all execution methods, see Running Guide
All settings are managed in the config.py
file. Here are some of the key options:
Setting | Description | Example |
---|---|---|
INSTAGRAM_URLS |
List of Instagram profile URLs to scrape | ["https://www.instagram.com/account/"] |
GOOGLE_SHEETS_ID |
The ID of the target Google Sheet | "1abcd1234efgh5678..." |
CREDENTIALS_FILE |
Path to Google API credentials | "credentials.json" |
TARGET_LINKS |
Number of Reels to scrape per account | 50 (0 = unlimited) |
DAYS_LIMIT |
Only scrape Reels from the last N days | 30 (0 = all time) |
Setting | Description | Default |
---|---|---|
HEADLESS |
Run browser in headless mode | False |
FAST_MODE |
Enable performance optimizations | True |
ENABLE_CONCURRENT_PROCESSING |
Use parallel processing | True |
MAX_SCRAPING_WORKERS |
Concurrent threads for scraping | 4 |
BATCH_SIZE |
Save to sheets every N new reels | 25 |
Setting | Description | Default |
---|---|---|
EXTRACT_DESCRIPTIONS |
Extract Reel descriptions | True |
UPLOAD_TO_GOOGLE_DRIVE |
Enable Google Drive uploads | False |
DRIVE_FOLDER_ID |
Google Drive destination folder | "" |
DELETE_LOCAL_AFTER_UPLOAD |
Clean up local files | True |
For complete configuration options, see Configuration Guide.
i2yt/
βββ .gitignore
βββ config.py # Your configuration (created from template)
βββ config_template.py # Configuration template with examples
βββ Launch_Instagram_Scraper.bat # Windows launcher (requires path customization)
βββ login_to_instagram.bat # Instagram login helper for Windows
βββ run_scraper.ps1 # PowerShell script for Windows
βββ credentials.json # Google API credentials (you create this)
βββ requirements.txt # Python dependencies
βββ description_extractor.py # Extract descriptions using yt-dlp
βββ google_drive_manager.py # Handles Google Drive video uploads
βββ google_sheets_manager.py # Manages Google Sheets interactions
βββ instagram_scraper.py # Main Instagram scraping engine
βββ instagram_scraper_clean.py # Alternative clean scraper implementation
βββ main_processor.py # Orchestrates the complete workflow
βββ parallel_processor.py # Handles concurrent processing for performance
βββ run_scraper.py # Python entry point with CLI options
βββ setup.py # Automated setup and configuration helper
βββ n8n_workflow.json # n8n workflow template for automation
βββ docs/ # Comprehensive documentation
β βββ quick_start.md # Get started in 10 minutes
β βββ running_guide.md # Complete guide to execution methods
β βββ configuration.md # Complete configuration guide
β βββ google_sheets_setup.md # Step-by-step Google API setup
β βββ n8n_integration.md # YouTube automation with n8n
β βββ advanced_usage.md # Power user features
β βββ developer_guide.md # For developers and contributors
β βββ troubleshooting.md # Common issues and solutions
β βββ technical_sheets_permissions.md # Google Sheets permissions fix
βββ tests/ # Testing and validation tools
β βββ test_google_api.py # Test Google API connectivity
β βββ test_sheets.py # Test Google Sheets integration
β βββ demo.py # Quick demo and setup verification
βββ downloaded_reels/ # Local video storage (auto-created)
βββ instagram_profile/ # Chrome profile for Instagram login
βββ __pycache__/ # Python bytecode cache
Contributions are welcome! Please feel free to submit a pull request.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m '''Add some AmazingFeature'''
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
This tool is for educational purposes only. Please be responsible and respect Instagram'''s terms of service. The developers are not responsible for any misuse of this tool.