Automation scripts to shuttle short-form videos between Instagram Reels and YouTube Shorts:
reels_shorts/reels_to_shorts: downloads your Instagram reels and uploads them to YouTube Shorts.reels_shorts/shorts_to_reels: searches YouTube Shorts, downloads them, adjusts aspect ratio, and uploads them as Instagram reels.
- Python 3.10+
- FFmpeg installed and on PATH
- A Google account with an active YouTube channel (for uploads)
- Instagram credentials
- Clone and enter the repo:
git clone http://github.com/germanProgq/repostero cd repostero - Create/activate a virtualenv, then install dependencies for both pipelines:
python3 -m venv .venv source .venv/bin/activate pip install -r reels_shorts/reels_to_shorts/requirements.txt pip install -r reels_shorts/shorts_to_reels/requirements.txt - Environment:
- Create
.envat repo root (or inside each project) with:INSTAGRAM_USERNAME=your_username INSTAGRAM_PASSWORD=your_password - For YouTube uploads, place OAuth client secrets at
reels_shorts/reels_to_shorts/assets/token/client_secrets.json(or adjust paths).
- Create
Script: reels_shorts/reels_to_shorts/run_reels_to_shorts.py
- Ensure
client_secrets.jsonexists and run once to generatetoken.jsonwhen prompted. - Run:
cd reels_shorts/reels_to_shorts python run_reels_to_shorts.py - The script:
- Logs into Instagram (reuses
session.jsonif present). - Downloads new reels (skips already processed IDs tracked in
processed_reels.json). - Uploads to YouTube Shorts with a simple “Subscribe ” caption/title.
- Deletes uploaded files to save space.
- Logs into Instagram (reuses
Script: reels_shorts/shorts_to_reels/run_shorts_to_reels.py
- Run with a search query:
cd reels_shorts/shorts_to_reels python run_shorts_to_reels.py "cats"
- The script:
- Scrapes YouTube Shorts for the query.
- Downloads each short (prefers audio+video formats; retries if audio missing).
- Validates, crops/resizes to 9:16, and uploads to Instagram.
- Tracks processed YouTube IDs in
processed_shorts.jsonand deletes uploaded files.
- Logs go to
app.login each script directory and to stdout with colored levels. - Temporary downloads live in
reels_shorts/*/downloads; successful uploads are removed automatically. - Processed caches:
processed_reels.json,processed_shorts.json.
- Missing FFmpeg: install and ensure
ffmpeg/ffprobeare on PATH. - YouTube upload limit errors: wait for daily quota reset or switch accounts.
- Instagram login issues: delete
session.jsonto force a fresh login, ensure credentials are correct, and avoid frequent logins to reduce risk of challenge prompts.