# marvinvr/auto-yt-shorts architecture

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

- Interactive diagram: https://gitdiagram.com/marvinvr/auto-yt-shorts
- Repository: https://github.com/marvinvr/auto-yt-shorts

## Overview

Auto-YT-Shorts automates short-video production, from topic and title selection through script, footage, narration, editing, metadata, and upload. `main.py` coordinates the workflow and can run once or on a cron schedule; it also reports success and failures. The README additionally names TikTok as a target and describes parallel processing, but the excerpts do not show TikTok dispatch or parallel execution, so those capabilities are not connected as runtime steps. Relationships below follow shown calls or documented integrations; unsampled internals are not inferred.

Main entry points: [`main.py`](https://github.com/marvinvr/auto-yt-shorts/blob/main/main.py) (Generation workflow), [`utils/llm.py`](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/llm.py) (Topic and copy generation), [`utils/stock_videos.py`](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/stock_videos.py) (Stock footage search), [`utils/video.py`](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/video.py) (Video assembly and subtitles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_coordination["Workflow coordination"]
  node_orchestrator["Generation workflow<br/>[main.py]"]
  node_configuration["Runtime configuration<br/>[config.py]"]
end

subgraph group_content["Content generation"]
  node_llm["Topic and copy generation<br/>[llm.py]"]
end

subgraph group_media["Media production"]
  node_stock["Stock footage search<br/>[stock_videos.py]"]
  node_video_helpers["Footage download<br/>[video.py]"]
  node_voiceover["Voiceover generation<br/>[audio.py]"]
  node_video_editor["Video assembly and subtitles<br/>[video.py]"]
end

subgraph group_delivery["Publishing and alerts"]
  node_metadata["Video and metadata saving<br/>[metadata.py]"]
  node_youtube_dispatch["Upload dispatch<br/>[yt.py]"]
  node_youtube_uploader["OAuth video uploader<br/>[upload_video.py]"]
  node_notifications["Status notifications<br/>[notifications.py]"]
  node_tiktok["TikTok module<br/>[tiktok.py]"]
end

node_initiator(("Schedule or operator"))
node_openai{{"OpenAI API"}}
node_news{{"News API"}}
node_pexels{{"Pexels API"}}
node_gemini{{"Gemini TTS"}}
node_assemblyai{{"AssemblyAI transcription"}}
node_youtube{{"YouTube Data API"}}
node_apprise{{"Apprise notification service"}}

node_initiator -->|"starts or schedules"| node_orchestrator
node_orchestrator -->|"requests content"| node_llm
node_llm -->|"generates copy"| node_openai
node_llm -->|"fetches headlines"| node_news
node_orchestrator -->|"requests footage"| node_stock
node_stock -->|"searches footage"| node_pexels
node_stock -->|"downloads clips"| node_video_helpers
node_orchestrator -->|"requests narration"| node_voiceover
node_voiceover -->|"generates speech"| node_gemini
node_orchestrator -->|"assembles video"| node_video_editor
node_video_editor -->|"transcribes audio"| node_assemblyai
node_orchestrator -->|"saves video details"| node_metadata
node_orchestrator -->|"requests upload"| node_youtube_dispatch
node_youtube_dispatch -->|"runs uploader"| node_youtube_uploader
node_youtube_uploader -->|"uploads video"| node_youtube
node_orchestrator -->|"reports outcome"| node_notifications
node_notifications -->|"sends alerts"| node_apprise
node_configuration -->|"sets schedule"| node_orchestrator
node_video_editor -.-> node_tiktok

click node_orchestrator "https://github.com/marvinvr/auto-yt-shorts/blob/main/main.py"
click node_configuration "https://github.com/marvinvr/auto-yt-shorts/blob/main/config.py"
click node_llm "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/llm.py"
click node_stock "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/stock_videos.py"
click node_video_helpers "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/video.py"
click node_voiceover "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/audio.py"
click node_video_editor "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/video.py"
click node_metadata "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/metadata.py"
click node_youtube_dispatch "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/yt.py"
click node_youtube_uploader "https://github.com/marvinvr/auto-yt-shorts/blob/main/upload_video.py"
click node_notifications "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/notifications.py"
click node_tiktok "https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/tiktok.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_orchestrator,node_configuration toneBlue
class node_llm toneAmber
class node_stock,node_video_helpers,node_voiceover,node_video_editor,node_openai,node_news,node_pexels,node_youtube toneMint
class node_metadata,node_youtube_dispatch,node_youtube_uploader,node_notifications,node_tiktok toneRose
class node_initiator,node_gemini,node_assemblyai,node_apprise toneIndigo
```

## Components

### Workflow coordination

- [Generation workflow](https://github.com/marvinvr/auto-yt-shorts/blob/main/main.py): `main.py`
- [Runtime configuration](https://github.com/marvinvr/auto-yt-shorts/blob/main/config.py): `config.py`

### Content generation

- [Topic and copy generation](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/llm.py): `utils/llm.py`

### Media production

- [Stock footage search](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/stock_videos.py): `utils/stock_videos.py`
- [Footage download](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/video.py): `utils/video.py`
- [Voiceover generation](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/audio.py): `utils/audio.py`
- [Video assembly and subtitles](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/video.py): `utils/video.py`

### Publishing and alerts

- [Video and metadata saving](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/metadata.py): `utils/metadata.py`
- [Upload dispatch](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/yt.py): `utils/yt.py`
- [OAuth video uploader](https://github.com/marvinvr/auto-yt-shorts/blob/main/upload_video.py): `upload_video.py`
- [Status notifications](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/notifications.py): `utils/notifications.py`
- [TikTok module](https://github.com/marvinvr/auto-yt-shorts/blob/main/utils/tiktok.py): `utils/tiktok.py`

### Other components

- **Schedule or operator**
- **OpenAI API**
- **News API**
- **Pexels API**
- **Gemini TTS**
- **AssemblyAI transcription**
- **YouTube Data API**
- **Apprise notification service**

## Connections

- Schedule or operator → Generation workflow: starts or schedules (evidence: `main.py`)
- Generation workflow → Topic and copy generation: requests content (evidence: `main.py`)
- Topic and copy generation → OpenAI API: generates copy (evidence: `utils/llm.py`)
- Topic and copy generation → News API: fetches headlines (evidence: `utils/llm.py`)
- Generation workflow → Stock footage search: requests footage (evidence: `main.py`)
- Stock footage search → Pexels API: searches footage (evidence: `utils/stock_videos.py`)
- Stock footage search → Footage download: downloads clips (evidence: `utils/stock_videos.py`)
- Generation workflow → Voiceover generation: requests narration (evidence: `main.py`)
- Voiceover generation → Gemini TTS: generates speech (evidence: `utils/audio.py`)
- Generation workflow → Video assembly and subtitles: assembles video (evidence: `main.py`)
- Video assembly and subtitles → AssemblyAI transcription: transcribes audio (evidence: `utils/video.py`)
- Generation workflow → Video and metadata saving: saves video details (evidence: `main.py`)
- Generation workflow → Upload dispatch: requests upload (evidence: `main.py`)
- Upload dispatch → OAuth video uploader: runs uploader (evidence: `utils/yt.py`)
- OAuth video uploader → YouTube Data API: uploads video (evidence: `upload_video.py`)
- Generation workflow → Status notifications: reports outcome (evidence: `main.py`)
- Status notifications → Apprise notification service: sends alerts (evidence: `utils/notifications.py`)
- Runtime configuration → Generation workflow: sets schedule (evidence: `main.py`)
- Video assembly and subtitles → TikTok module
