# tharana-dev/video-downloader architecture

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

- Interactive diagram: https://gitdiagram.com/tharana-dev/video-downloader
- Repository: https://github.com/tharana-dev/video-downloader

## Overview

This is a command-line media downloader. The main workflow gathers a URL and download preferences, scouts metadata and available resolutions, downloads and converts the selected media with yt-dlp/FFmpeg, then records successful downloads. The README also describes viewing the log, but the sampled logger implements only appending records; no log-viewer implementation is present. The graph follows the sampled entry-point calls and README-documented capabilities.

Main entry points: [`downloader.py`](https://github.com/tharana-dev/video-downloader/blob/main/downloader.py) (Media downloader), [`main.py`](https://github.com/tharana-dev/video-downloader/blob/main/main.py) (Workflow entry), [`input_file.py`](https://github.com/tharana-dev/video-downloader/blob/main/input_file.py) (URL and preferences), [`logger.py`](https://github.com/tharana-dev/video-downloader/blob/main/logger.py) (Download log writer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Input and scouting"]
  node_entry["Workflow entry<br/>[main.py]"]
  node_preferences["URL and preferences<br/>[input_file.py]"]
  node_scouting["Metadata and quality scout<br/>[input_file.py]"]
  node_naming["Filename and destination<br/>[input_file.py]"]
end

subgraph group_download["Download processing"]
  node_engine["Media downloader<br/>[downloader.py]"]
  node_progress["Progress display<br/>[downloader.py]"]
  node_output["Downloaded media file"]
end

subgraph group_records["Download records"]
  node_log_writer["Download log writer<br/>[logger.py]"]
  node_log_file["Download history"]
  node_log_viewer["Log viewer"]
end

node_user(("CLI user"))
node_platform(("Supported media platforms"))
node_ffmpeg["FFmpeg processing"]

node_user -->|"runs"| node_entry
node_entry -->|"requests details"| node_preferences
node_preferences -->|"scouts metadata"| node_platform
node_preferences -->|"extracts metadata"| node_scouting
node_preferences -->|"collects preferences"| node_naming
node_entry -->|"starts download"| node_engine
node_engine -->|"downloads media"| node_platform
node_engine -->|"updates progress"| node_progress
node_engine -->|"configures processing"| node_ffmpeg
node_engine -->|"writes media"| node_output
node_entry -->|"logs success"| node_log_writer
node_log_writer -->|"appends record"| node_log_file
node_user -.->|"can request"| node_log_viewer

click node_entry "https://github.com/tharana-dev/video-downloader/blob/main/main.py"
click node_preferences "https://github.com/tharana-dev/video-downloader/blob/main/input_file.py"
click node_scouting "https://github.com/tharana-dev/video-downloader/blob/main/input_file.py"
click node_naming "https://github.com/tharana-dev/video-downloader/blob/main/input_file.py"
click node_engine "https://github.com/tharana-dev/video-downloader/blob/main/downloader.py"
click node_progress "https://github.com/tharana-dev/video-downloader/blob/main/downloader.py"
click node_log_writer "https://github.com/tharana-dev/video-downloader/blob/main/logger.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_entry,node_preferences,node_scouting,node_naming,node_user toneBlue
class node_engine,node_progress,node_output toneAmber
class node_log_writer,node_log_file,node_log_viewer toneMint
class node_platform,node_ffmpeg toneIndigo
```

## Components

### Input and scouting

- [Workflow entry](https://github.com/tharana-dev/video-downloader/blob/main/main.py): `main.py`
- [URL and preferences](https://github.com/tharana-dev/video-downloader/blob/main/input_file.py): `input_file.py`
- [Metadata and quality scout](https://github.com/tharana-dev/video-downloader/blob/main/input_file.py): `input_file.py`
- [Filename and destination](https://github.com/tharana-dev/video-downloader/blob/main/input_file.py): `input_file.py`

### Download processing

- [Media downloader](https://github.com/tharana-dev/video-downloader/blob/main/downloader.py): `downloader.py`
- [Progress display](https://github.com/tharana-dev/video-downloader/blob/main/downloader.py): `downloader.py`
- **Downloaded media file**

### Download records

- [Download log writer](https://github.com/tharana-dev/video-downloader/blob/main/logger.py): `logger.py`
- **Download history**
- **Log viewer**

### Other components

- **CLI user**
- **Supported media platforms**
- **FFmpeg processing**

## Connections

- CLI user → Workflow entry: runs (evidence: `Readme.md`)
- Workflow entry → URL and preferences: requests details (evidence: `main.py`)
- URL and preferences → Supported media platforms: scouts metadata (evidence: `input_file.py`)
- URL and preferences → Metadata and quality scout: extracts metadata (evidence: `input_file.py`)
- URL and preferences → Filename and destination: collects preferences (evidence: `input_file.py`)
- Workflow entry → Media downloader: starts download (evidence: `main.py`)
- Media downloader → Supported media platforms: downloads media (evidence: `downloader.py`)
- Media downloader → Progress display: updates progress (evidence: `downloader.py`)
- Media downloader → FFmpeg processing: configures processing (evidence: `downloader.py`)
- Media downloader → Downloaded media file: writes media (evidence: `downloader.py`)
- Workflow entry → Download log writer: logs success (evidence: `main.py`)
- Download log writer → Download history: appends record (evidence: `logger.py`)
- CLI user → Log viewer: can request (evidence: `Readme.md`)
