InstaRepost

Instagram Auto Reposter

A Python application that automatically reposts saved Instagram content to your own account with proper attribution.

Features

Requirements

Installation

  1. Clone this repository:
    git clone https://github.com/Likhithsai2580/InstaRepost.git
    cd InstaRepost
    
  2. Install required packages:
    pip install instagrapi colorama python-dotenv schedule moviepy==1.0.3
    
  3. Create a .env file with your Instagram credentials:
    INSTAGRAM_USERNAME=your_username
    INSTAGRAM_PASSWORD=your_password
    REPOST_CAPTION="Reposted"
    CHECK_INTERVAL_MINUTES=30
    HISTORY_FILE=repost_history.json
    MEDIA_FOLDER=instagram_media
    KEEP_MEDIA=False
    

Usage

Run the script:

python insta_reposter.py

The script will:

  1. Log into your Instagram account (with cookie support for persistent sessions)
  2. Check for saved posts at the interval specified in your .env file
  3. Process each saved post (like, download, repost, unsave)
  4. Keep track of reposted content to avoid duplicates

Environment Variables

Variable Description Default
INSTAGRAM_USERNAME Your Instagram username (Required)
INSTAGRAM_PASSWORD Your Instagram password (Required)
REPOST_CAPTION Caption prefix for reposted content “Reposted”
CHECK_INTERVAL_MINUTES How often to check for new saved posts (in minutes) 30
HISTORY_FILE File to store repost history repost_history.json
MEDIA_FOLDER Folder to temporarily store downloaded media instagram_media
COOKIES_FILE File to store Instagram session cookies instagram_cookies.json
KEEP_MEDIA Whether to keep downloaded media files (true/false) False

How It Works

  1. Save a post on Instagram
  2. The script detects the saved content during its next check
  3. The script likes the original post
  4. The content is downloaded temporarily
  5. The content is reposted to your profile with proper attribution
  6. The post is removed from your saved collection
  7. The post is added to history to avoid reposting

Security and Error Handling

Important Notes

Troubleshooting

If you encounter issues:

  1. Check the console output for error messages
  2. Ensure your Instagram credentials are correct
  3. If you get login challenges, the script will prompt for verification codes
  4. For persistent login issues, delete the cookies file and try again

License

MIT