# shouryan/auto-shorts-bot architecture

> Architecture diagram of the GitHub repository shouryan/auto-shorts-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shouryan/auto-shorts-bot
- Repository: https://github.com/shouryan/auto-shorts-bot

## Overview

This is an automated YouTube Shorts creator: the runner invokes script generation, voiceover, video assembly, captioning, and upload. The sampled stages use Gemini, Edge TTS, Whisper/MoviePy, and the YouTube API. The source excerpts show an apparent filename mismatch: assembly writes `final_short_automated.mp4`, while captioning expects `final_short_overlay.mp4`; the runner nevertheless proceeds to upload `final_short_automated.mp4`. Image generation is not implemented in the sampled files. No README was provided, so unsampled capabilities and wiring are omitted.

Main entry points: [`main.py`](https://github.com/shouryan/auto-shorts-bot/blob/main/main.py) (Pipeline runner), [`step2_media.py`](https://github.com/shouryan/auto-shorts-bot/blob/main/step2_media.py) (Voiceover generation), [`step1_scripting.py`](https://github.com/shouryan/auto-shorts-bot/blob/main/step1_scripting.py) (Script generation), [`step3_assembly.py`](https://github.com/shouryan/auto-shorts-bot/blob/main/step3_assembly.py) (Video assembly)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Job orchestration"]
  node_runner["Pipeline runner<br/>[main.py]"]
end

subgraph group_creation["Short creation"]
  node_script["Script generation<br/>[step1_scripting.py]"]
  node_gemini{{"Gemini API"}}
  node_voiceover["Voiceover generation<br/>[step2_media.py]"]
  node_edge_tts{{"Edge TTS"}}
  node_assembly["Video assembly<br/>[step3_assembly.py]"]
  node_background["Background video<br/>[background.mp4]"]
  node_captions["Caption rendering<br/>[step5_captions.py]"]
  node_whisper{{"Whisper transcription"}}
end

subgraph group_publishing["Publishing"]
  node_youtube_upload["YouTube upload<br/>[step6_upload.py]"]
  node_youtube{{"YouTube"}}
end

node_operator(("Operator"))

node_operator -->|"starts"| node_runner
node_runner -->|"runs"| node_script
node_runner -->|"runs"| node_voiceover
node_runner -->|"runs"| node_assembly
node_runner -->|"runs"| node_captions
node_runner -->|"runs"| node_youtube_upload
node_script -->|"generates script"| node_gemini
node_voiceover -->|"reads script"| node_script
node_voiceover -->|"generates speech"| node_edge_tts
node_assembly -->|"reads video"| node_background
node_captions -->|"transcribes audio"| node_whisper
node_youtube_upload -->|"uploads video"| node_youtube

click node_runner "https://github.com/shouryan/auto-shorts-bot/blob/main/main.py"
click node_script "https://github.com/shouryan/auto-shorts-bot/blob/main/step1_scripting.py"
click node_voiceover "https://github.com/shouryan/auto-shorts-bot/blob/main/step2_media.py"
click node_assembly "https://github.com/shouryan/auto-shorts-bot/blob/main/step3_assembly.py"
click node_background "https://github.com/shouryan/auto-shorts-bot/blob/main/background.mp4"
click node_captions "https://github.com/shouryan/auto-shorts-bot/blob/main/step5_captions.py"
click node_youtube_upload "https://github.com/shouryan/auto-shorts-bot/blob/main/step6_upload.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner toneBlue
class node_script,node_gemini,node_voiceover,node_edge_tts,node_assembly,node_background,node_captions,node_whisper toneAmber
class node_youtube_upload,node_youtube toneMint
class node_operator toneIndigo
```

## Components

### Job orchestration

- [Pipeline runner](https://github.com/shouryan/auto-shorts-bot/blob/main/main.py): `main.py`

### Short creation

- [Script generation](https://github.com/shouryan/auto-shorts-bot/blob/main/step1_scripting.py): `step1_scripting.py`
- **Gemini API**
- [Voiceover generation](https://github.com/shouryan/auto-shorts-bot/blob/main/step2_media.py): `step2_media.py`
- **Edge TTS**
- [Video assembly](https://github.com/shouryan/auto-shorts-bot/blob/main/step3_assembly.py): `step3_assembly.py`
- [Background video](https://github.com/shouryan/auto-shorts-bot/blob/main/background.mp4): `background.mp4`
- [Caption rendering](https://github.com/shouryan/auto-shorts-bot/blob/main/step5_captions.py): `step5_captions.py`
- **Whisper transcription**

### Publishing

- [YouTube upload](https://github.com/shouryan/auto-shorts-bot/blob/main/step6_upload.py): `step6_upload.py`
- **YouTube**

### Other components

- **Operator**

## Connections

- Operator → Pipeline runner: starts (evidence: `main.py`)
- Pipeline runner → Script generation: runs (evidence: `main.py`)
- Pipeline runner → Voiceover generation: runs (evidence: `main.py`)
- Pipeline runner → Video assembly: runs (evidence: `main.py`)
- Pipeline runner → Caption rendering: runs (evidence: `main.py`)
- Pipeline runner → YouTube upload: runs (evidence: `main.py`)
- Script generation → Gemini API: generates script (evidence: `step1_scripting.py`)
- Voiceover generation → Script generation: reads script (evidence: `step2_media.py`)
- Voiceover generation → Edge TTS: generates speech (evidence: `step2_media.py`)
- Video assembly → Background video: reads video (evidence: `step3_assembly.py`)
- Caption rendering → Whisper transcription: transcribes audio (evidence: `step5_captions.py`)
- YouTube upload → YouTube: uploads video (evidence: `step6_upload.py`)
