# abdaluh-alotiby/pyflask-youtube-download architecture

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

- Interactive diagram: https://gitdiagram.com/abdaluh-alotiby/pyflask-youtube-download
- Repository: https://github.com/abdaluh-alotiby/pyflask-youtube-download

## Overview

This Flask application accepts YouTube URLs, displays video information and an embed, and provides download-link routes. The main workflow is browser form submission → URL normalization and metadata lookup → rendered results; download requests instead resolve a link through an external downloader service. URL conversion, metadata retrieval, and download resolution are distinct responsibilities implemented in main.py. The source excerpts show these route-to-function calls, but templates and external service behavior are not sampled.

Main entry points: [`app.py`](https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/app.py) (Flask routes), [`main.py`](https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.py) (URL normalization), [`templates`](https://github.com/abdaluh-alotiby/pyflask-youtube-download/tree/main/templates) (HTML pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_routes["Flask routes<br/>[app.py]"]
  node_pages["HTML pages"]
end

subgraph group_youtube["YouTube processing"]
  node_normalize["URL normalization<br/>[main.py]"]
  node_embed["Embed conversion<br/>[main.py]"]
  node_metadata["Video metadata<br/>[main.py]"]
  node_pytube["pytube / YouTube"]
end

subgraph group_download["Download resolution"]
  node_linkresolver["Download link resolver<br/>[main.py]"]
  node_downloader["10downloader service"]
end

node_visitor(("Browser visitor"))

node_visitor -->|"submits forms"| node_routes
node_routes -->|"normalizes URL"| node_normalize
node_routes -->|"requests metadata"| node_metadata
node_metadata -->|"reads video details"| node_pytube
node_routes -->|"builds embed URL"| node_embed
node_routes -->|"renders results"| node_pages
node_routes -->|"requests download link"| node_linkresolver
node_linkresolver -->|"fetches download page"| node_downloader
node_visitor -->|"requests download"| node_routes
node_normalize -->|"converts Shorts URL"| node_normalize

click node_routes "https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/app.py"
click node_pages "https://github.com/abdaluh-alotiby/pyflask-youtube-download/tree/main/templates"
click node_normalize "https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.py"
click node_embed "https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.py"
click node_metadata "https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.py"
click node_linkresolver "https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.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_routes,node_pages,node_visitor toneBlue
class node_normalize,node_embed,node_metadata,node_pytube toneAmber
class node_linkresolver,node_downloader toneMint
```

## Components

### Web interface

- [Flask routes](https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/app.py): `app.py`
- [HTML pages](https://github.com/abdaluh-alotiby/pyflask-youtube-download/tree/main/templates): `templates`

### YouTube processing

- [URL normalization](https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.py): `main.py`
- [Embed conversion](https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.py): `main.py`
- [Video metadata](https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.py): `main.py`
- **pytube / YouTube**

### Download resolution

- [Download link resolver](https://github.com/abdaluh-alotiby/pyflask-youtube-download/blob/main/main.py): `main.py`
- **10downloader service**

### Other components

- **Browser visitor**

## Connections

- Browser visitor → Flask routes: submits forms (evidence: `app.py`)
- Flask routes → URL normalization: normalizes URL (evidence: `app.py`)
- Flask routes → Video metadata: requests metadata (evidence: `app.py`)
- Video metadata → pytube / YouTube: reads video details (evidence: `main.py`)
- Flask routes → Embed conversion: builds embed URL (evidence: `app.py`)
- Flask routes → HTML pages: renders results (evidence: `app.py`)
- Flask routes → Download link resolver: requests download link (evidence: `app.py`)
- Download link resolver → 10downloader service: fetches download page (evidence: `main.py`)
- Browser visitor → Flask routes: requests download (evidence: `app.py`)
- URL normalization → URL normalization: converts Shorts URL (evidence: `main.py`)
