A Python bot that scrapes media from a rotating set of Reddit subreddits and auto-posts it to an Instagram account as photos, reels, videos, and stories. It watermarks images, attaches randomized hashtags, and sleeps for a random number of hours between runs.
⚠️ Educational / hobby project. Automating posting may violate Reddit's and Instagram's Terms of Service and content licensing. Use responsibly and only with content you have the right to repost.
- Picks a random subreddit and pulls a random post via PRAW.
- Downloads the media (images directly, videos via
yt-dlp). - For images, overlays a watermark using Pillow.
- Logs into Instagram via instagrapi and uploads as a photo / reel / video / IGTV, and optionally a story.
- Logs out and sleeps before the next cycle.
- Python 3.10
ffmpegavailable on yourPATH- The packages in
requirements.txt
pip install -r requirements.txtAll credentials are read from environment variables. Copy the example file and fill in your own values:
cp .env.example .env
# edit .env| Variable | Description |
|---|---|
REDDIT_CLIENT_ID |
Reddit app client id |
REDDIT_CLIENT_SECRET |
Reddit app client secret |
REDDIT_USERNAME |
Reddit account username |
REDDIT_PASSWORD |
Reddit account password |
REDDIT_USER_AGENT |
Reddit user agent string (optional) |
USERNAME |
Instagram username |
PASS |
Instagram password |
PASTEBIN_API_KEY |
Pastebin API key (optional; only for the disabled paste feature) |
python main.pyProcfile, runtime.txt, and okteto-pipeline.yml are included for deploying
as a worker (Heroku-style / Okteto).