# uxharshit/pinterestvideodownloader architecture

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

- Interactive diagram: https://gitdiagram.com/uxharshit/pinterestvideodownloader
- Repository: https://github.com/uxharshit/pinterestvideodownloader

## Overview

A small command-line Pinterest video downloader: the user enters a pin URL, the script optionally resolves a pin.it short link, extracts a video URL, converts its HLS path to an MP4 URL, and downloads the file with terminal progress. The single source file implements these stages. The README documents both supported URL forms and progress display; no separate storage or service layer is present.

Main entry points: [`main.py`](https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py) (CLI workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and extraction"]
  node_cli["CLI workflow<br/>[main.py]"]
  node_short_resolver["Short-link resolver<br/>[main.py]"]
  node_pin_page["Pin page fetch<br/>[main.py]"]
  node_video_extractor["Video URL extractor<br/>[main.py]"]
  node_url_converter["HLS to MP4<br/>[main.py]"]
end

subgraph group_download["Video download"]
  node_downloader["File downloader<br/>[main.py]"]
  node_progress["Progress display<br/>[main.py]"]
  node_mp4_file["MP4 file"]
end

node_user(("User"))
node_pinterest{{"Pinterest"}}

node_user -->|"enters URL"| node_cli
node_cli -->|"resolves short URL"| node_short_resolver
node_short_resolver -->|"requests redirect page"| node_pinterest
node_cli -->|"fetches pin page"| node_pin_page
node_pin_page -->|"requests page"| node_pinterest
node_pin_page -->|"supplies page text"| node_video_extractor
node_short_resolver -->|"returns pin URL"| node_cli
node_video_extractor -->|"passes video URL"| node_url_converter
node_url_converter -->|"passes MP4 URL"| node_downloader
node_cli -->|"starts download"| node_downloader
node_downloader -->|"requests video stream"| node_pinterest
node_downloader -->|"iterates download"| node_progress
node_downloader -->|"writes bytes"| node_mp4_file

click node_cli "https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py"
click node_short_resolver "https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py"
click node_pin_page "https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py"
click node_video_extractor "https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py"
click node_url_converter "https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py"
click node_downloader "https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py"
click node_progress "https://github.com/uxharshit/pinterestvideodownloader/blob/master/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_cli,node_short_resolver,node_pin_page,node_video_extractor,node_url_converter,node_user toneBlue
class node_downloader,node_progress,node_mp4_file toneAmber
class node_pinterest toneIndigo
```

## Components

### Input and extraction

- [CLI workflow](https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py): `main.py`
- [Short-link resolver](https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py): `main.py`
- [Pin page fetch](https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py): `main.py`
- [Video URL extractor](https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py): `main.py`
- [HLS to MP4](https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py): `main.py`

### Video download

- [File downloader](https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py): `main.py`
- [Progress display](https://github.com/uxharshit/pinterestvideodownloader/blob/master/main.py): `main.py`
- **MP4 file**

### Other components

- **User**
- **Pinterest**

## Connections

- User → CLI workflow: enters URL (evidence: `readme.md`)
- CLI workflow → Short-link resolver: resolves short URL (evidence: `main.py`)
- Short-link resolver → Pinterest: requests redirect page (evidence: `main.py`)
- CLI workflow → Pin page fetch: fetches pin page (evidence: `main.py`)
- Pin page fetch → Pinterest: requests page (evidence: `main.py`)
- Pin page fetch → Video URL extractor: supplies page text (evidence: `main.py`)
- Short-link resolver → CLI workflow: returns pin URL (evidence: `main.py`)
- Video URL extractor → HLS to MP4: passes video URL (evidence: `main.py`)
- HLS to MP4 → File downloader: passes MP4 URL (evidence: `main.py`)
- CLI workflow → File downloader: starts download (evidence: `main.py`)
- File downloader → Pinterest: requests video stream (evidence: `main.py`)
- File downloader → Progress display: iterates download (evidence: `main.py`)
- File downloader → MP4 file: writes bytes (evidence: `main.py`)
