# lecodeurdu78/robotyoutubeur architecture

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

- Interactive diagram: https://gitdiagram.com/lecodeurdu78/robotyoutubeur
- Repository: https://github.com/lecodeurdu78/robotyoutubeur
- Video tour (about a minute): https://gitdiagram.com/lecodeurdu78/robotyoutubeur/video

## Overview

This is a Python video-curation and cross-platform publishing script. Its main workflow authenticates a YouTube account, finds recently published high-view videos, downloads them, creates split-screen edits around selected moments, then uploads the edits to YouTube and TikTok and removes intermediate files. The graph separates selection, source-video retrieval, editing, and publishing. Relationships are based on the shown source; the README is empty, and the referenced second video asset is not present in the tree.

Main entry points: [`main.py`](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/main.py) (Workflow runner), [`upload.py`](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/upload.py) (Platform upload dispatcher), [`download.py`](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/download.py) (Trending-video selection), [`montage.py`](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/montage.py) (Moment trimming and split-screen edit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Workflow orchestration"]
  node_main["Workflow runner<br/>[main.py]"]
  node_cleanup["Temporary-file cleanup<br/>[main.py]"]
end

subgraph group_collection["Video collection"]
  node_selection["Trending-video selection<br/>[download.py]"]
  node_metadata["Title and moment lookup<br/>[download.py]"]
  node_fetch["Source-video download<br/>[download.py]"]
end

subgraph group_editing["Video editing"]
  node_editing["Moment trimming and split-screen edit<br/>[montage.py]"]
end

subgraph group_publishing["Authentication and publishing"]
  node_auth["YouTube authentication<br/>[authenticate.py]"]
  node_publish["Platform upload dispatcher<br/>[upload.py]"]
  node_youtube_upload["YouTube publishing<br/>[upload.py]"]
  node_tiktok_upload["TikTok publishing<br/>[upload.py]"]
end

node_user(("Operator"))
node_google["Google OAuth / YouTube API"]
node_tiktok["TikTok Creator Center"]

node_user -->|"starts"| node_main
node_main -->|"authenticates"| node_auth
node_auth -->|"requests credentials"| node_google
node_main -->|"selects videos"| node_selection
node_selection -->|"searches videos"| node_google
node_main -->|"downloads sources"| node_fetch
node_fetch -->|"uses selected IDs"| node_selection
node_main -->|"gets titles and moments"| node_metadata
node_metadata -->|"queries video details"| node_google
node_main -->|"creates edits"| node_editing
node_editing -->|"reads downloaded clips"| node_fetch
node_main -->|"publishes edits"| node_publish
node_publish -->|"dispatches to"| node_youtube_upload
node_publish -->|"dispatches to"| node_tiktok_upload
node_youtube_upload -->|"uploads videos"| node_google
node_tiktok_upload -->|"uploads via browser"| node_tiktok
node_main -->|"removes intermediates"| node_cleanup

click node_main "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/main.py"
click node_cleanup "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/main.py"
click node_auth "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/authenticate.py"
click node_selection "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/download.py"
click node_metadata "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/download.py"
click node_fetch "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/download.py"
click node_editing "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/montage.py"
click node_publish "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/upload.py"
click node_youtube_upload "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/upload.py"
click node_tiktok_upload "https://github.com/lecodeurdu78/robotyoutubeur/blob/master/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_main,node_cleanup toneBlue
class node_selection,node_metadata,node_fetch toneAmber
class node_editing,node_google toneMint
class node_auth,node_publish,node_youtube_upload,node_tiktok_upload toneRose
class node_user,node_tiktok toneIndigo
```

## Components

### Workflow orchestration

- [Workflow runner](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/main.py): `main.py`
- [Temporary-file cleanup](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/main.py): `main.py`

### Video collection

- [Trending-video selection](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/download.py): `download.py`
- [Title and moment lookup](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/download.py): `download.py`
- [Source-video download](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/download.py): `download.py`

### Video editing

- [Moment trimming and split-screen edit](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/montage.py): `montage.py`

### Authentication and publishing

- [YouTube authentication](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/authenticate.py): `authenticate.py`
- [Platform upload dispatcher](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/upload.py): `upload.py`
- [YouTube publishing](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/upload.py): `upload.py`
- [TikTok publishing](https://github.com/lecodeurdu78/robotyoutubeur/blob/master/upload.py): `upload.py`

### Other components

- **Operator**
- **Google OAuth / YouTube API**
- **TikTok Creator Center**

## Connections

- Operator → Workflow runner: starts
- Workflow runner → YouTube authentication: authenticates (evidence: `main.py`)
- YouTube authentication → Google OAuth / YouTube API: requests credentials (evidence: `authenticate.py`)
- Workflow runner → Trending-video selection: selects videos (evidence: `main.py`)
- Trending-video selection → Google OAuth / YouTube API: searches videos (evidence: `download.py`)
- Workflow runner → Source-video download: downloads sources (evidence: `main.py`)
- Source-video download → Trending-video selection: uses selected IDs (evidence: `download.py`)
- Workflow runner → Title and moment lookup: gets titles and moments (evidence: `main.py`)
- Title and moment lookup → Google OAuth / YouTube API: queries video details (evidence: `download.py`)
- Workflow runner → Moment trimming and split-screen edit: creates edits (evidence: `main.py`)
- Moment trimming and split-screen edit → Source-video download: reads downloaded clips (evidence: `montage.py`)
- Workflow runner → Platform upload dispatcher: publishes edits (evidence: `main.py`)
- Platform upload dispatcher → YouTube publishing: dispatches to (evidence: `upload.py`)
- Platform upload dispatcher → TikTok publishing: dispatches to (evidence: `upload.py`)
- YouTube publishing → Google OAuth / YouTube API: uploads videos (evidence: `upload.py`)
- TikTok publishing → TikTok Creator Center: uploads via browser (evidence: `upload.py`)
- Workflow runner → Temporary-file cleanup: removes intermediates (evidence: `main.py`)
