# mdanasaliusmani/youtube_bot_learner architecture

> Architecture diagram of the GitHub repository mdanasaliusmani/youtube_bot_learner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mdanasaliusmani/youtube_bot_learner
- Repository: https://github.com/mdanasaliusmani/youtube_bot_learner

## Overview

This repository automates creation of channel-specific YouTube Shorts: choose a topic, generate a script and image prompts, create visuals and narration, produce timed captions, render a vertical video, and optionally upload it. The run script coordinates these stages and also handles language variants and repeat-avoidance state. The README documents scheduled daily runs, but workflow files are orchestration infrastructure rather than product runtime components. The README describes Hugging Face images, while the sampled image implementation calls DeAPI; unsampled provider behavior is not inferred.

Main entry points: [`scripts/run_short.py`](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/scripts/run_short.py) (Short runner), [`pipeline/groq_script.py`](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/groq_script.py) (Script generator), [`pipeline/myth_topics.py`](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/myth_topics.py) (Myth topic rotation), [`pipeline/images.py`](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/images.py) (Image generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_topic["Topic and scripting"]
  node_presets["Channel presets<br/>[channel_presets.py]"]
  node_myth_topics["Myth topic rotation<br/>[myth_topics.py]"]
  node_groq_script["Script generator<br/>[groq_script.py]"]
end

subgraph group_media["Media creation"]
  node_image_gen["Image generation<br/>[images.py]"]
  node_tts["Edge TTS synthesis<br/>[edge_tts_synth.py]"]
  node_captions["Timed captions<br/>[captions.py]"]
end

subgraph group_render["Video assembly"]
  node_renderer["Short renderer<br/>[render_short.py]"]
end

subgraph group_publish["Publishing and state"]
  node_story_history[("Story history<br/>[story_history.py]")]
  node_youtube_upload["YouTube uploader<br/>[youtube_upload.py]"]
  node_myth_state[("Myth rotation state<br/>[myth_topics.py]")]
end

node_operator(("Channel operator"))
node_runner["Short runner<br/>[run_short.py]"]
node_groq_service{{"Groq API"}}
node_deapi{{"DeAPI service"}}
node_edge_service{{"Edge TTS service"}}
node_ffmpeg{{"FFmpeg"}}
node_youtube{{"YouTube"}}

node_operator -->|"runs with options"| node_runner
node_runner -->|"selects channel"| node_presets
node_runner -->|"picks myth topic"| node_myth_topics
node_myth_topics -->|"reads and updates"| node_myth_state
node_runner -->|"requests script"| node_groq_script
node_groq_script -->|"uses preset"| node_presets
node_groq_script -->|"adds history context"| node_story_history
node_groq_script -->|"generates script"| node_groq_service
node_runner -->|"generates scenes"| node_image_gen
node_image_gen -->|"submits image jobs"| node_deapi
node_runner -->|"synthesizes narration"| node_tts
node_tts -->|"requests speech"| node_edge_service
node_runner -->|"builds timed SRT"| node_captions
node_runner -->|"assembles video"| node_renderer
node_renderer -->|"renders video"| node_ffmpeg
node_runner -->|"uploads optionally"| node_youtube_upload
node_youtube_upload -->|"uploads Short"| node_youtube

click node_runner "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/scripts/run_short.py"
click node_presets "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/channel_presets.py"
click node_myth_topics "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/myth_topics.py"
click node_groq_script "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/groq_script.py"
click node_story_history "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/story_history.py"
click node_image_gen "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/images.py"
click node_tts "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/edge_tts_synth.py"
click node_captions "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/captions.py"
click node_renderer "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/render_short.py"
click node_youtube_upload "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/youtube_upload.py"
click node_myth_state "https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/myth_topics.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_presets,node_myth_topics,node_groq_script toneBlue
class node_image_gen,node_tts,node_captions toneAmber
class node_renderer,node_groq_service,node_deapi toneMint
class node_story_history,node_youtube_upload,node_myth_state toneRose
class node_operator,node_edge_service,node_ffmpeg,node_youtube toneIndigo
class node_runner toneTeal
```

## Components

### Topic and scripting

- [Channel presets](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/channel_presets.py): `pipeline/channel_presets.py`
- [Myth topic rotation](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/myth_topics.py): `pipeline/myth_topics.py`
- [Script generator](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/groq_script.py): `pipeline/groq_script.py`

### Media creation

- [Image generation](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/images.py): `pipeline/images.py`
- [Edge TTS synthesis](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/edge_tts_synth.py): `pipeline/edge_tts_synth.py`
- [Timed captions](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/captions.py): `pipeline/captions.py`

### Video assembly

- [Short renderer](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/render_short.py): `pipeline/render_short.py`

### Publishing and state

- [Story history](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/story_history.py): `pipeline/story_history.py`
- [YouTube uploader](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/youtube_upload.py): `pipeline/youtube_upload.py`
- [Myth rotation state](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/pipeline/myth_topics.py): `pipeline/myth_topics.py`

### Other components

- **Channel operator**
- [Short runner](https://github.com/mdanasaliusmani/youtube_bot_learner/blob/master/scripts/run_short.py): `scripts/run_short.py`
- **Groq API**
- **DeAPI service**
- **Edge TTS service**
- **FFmpeg**
- **YouTube**

## Connections

- Channel operator → Short runner: runs with options (evidence: `README.md`)
- Short runner → Channel presets: selects channel (evidence: `scripts/run_short.py`)
- Short runner → Myth topic rotation: picks myth topic (evidence: `scripts/run_short.py`)
- Myth topic rotation → Myth rotation state: reads and updates (evidence: `pipeline/myth_topics.py`)
- Short runner → Script generator: requests script (evidence: `scripts/run_short.py`)
- Script generator → Channel presets: uses preset (evidence: `pipeline/groq_script.py`)
- Script generator → Story history: adds history context (evidence: `pipeline/groq_script.py`)
- Script generator → Groq API: generates script (evidence: `README.md`)
- Short runner → Image generation: generates scenes (evidence: `scripts/run_short.py`)
- Image generation → DeAPI service: submits image jobs (evidence: `pipeline/images.py`)
- Short runner → Edge TTS synthesis: synthesizes narration (evidence: `README.md`)
- Edge TTS synthesis → Edge TTS service: requests speech (evidence: `README.md`)
- Short runner → Timed captions: builds timed SRT (evidence: `README.md`)
- Short runner → Short renderer: assembles video (evidence: `README.md`)
- Short renderer → FFmpeg: renders video (evidence: `pipeline/render_short.py`)
- Short runner → YouTube uploader: uploads optionally (evidence: `scripts/run_short.py`)
- YouTube uploader → YouTube: uploads Short (evidence: `pipeline/youtube_upload.py`)
