# arvind88765/zee5_downloader architecture

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

- Interactive diagram: https://gitdiagram.com/arvind88765/zee5_downloader
- Repository: https://github.com/arvind88765/zee5_downloader

## Overview

Zee5 Downloader is a GUI application that turns a Zee5 URL into a selected, downloaded, decrypted, and remuxed MKV. Its documented workflow covers authentication, playback/manifest discovery, optional Widevine key retrieval, quality/audio/subtitle selection, and downloading with fallback engines. The runtime is implemented in one large Python file. The README documents the main flow and capabilities; sampled excerpts confirm parts of authentication, manifest parsing, DRM, and download configuration, but do not expose all call sites.

Main entry points: [`zee5_downloader.py`](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py) (Downloader GUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Discovery"]
  node_url["Content ID<br/>[zee5_downloader.py]"]
  node_tokens["Token Handling<br/>[zee5_downloader.py]"]
  node_playback["Playback Discovery<br/>[zee5_downloader.py]"]
  node_metadata["Content Metadata<br/>[zee5_downloader.py]"]
end

subgraph group_media["Media Preparation"]
  node_manifest["MPD Parser<br/>[zee5_downloader.py]"]
  node_drm["Widevine Keys<br/>[zee5_downloader.py]"]
end

subgraph group_interface["User Interface"]
  node_app["Downloader GUI<br/>[zee5_downloader.py]"]
  node_selection["Media Selection<br/>[zee5_downloader.py]"]
end

subgraph group_delivery["Download and Output"]
  node_download["Download Engine<br/>[zee5_downloader.py]"]
  node_remux["MKV Remux<br/>[zee5_downloader.py]"]
  node_output["Final MKV"]
end

node_user(("User"))
node_publicjs["Zee5 Public JS"]
node_authapi["Zee5 Auth API"]
node_zeeapi["Zee5 Playback API"]
node_cdm["Local WVD CDM"]
node_license["Zee5 License API"]
node_nstream["N_m3u8DL-RE"]
node_ytdlp["yt-dlp"]
node_ffmpeg["ffmpeg"]
node_mkvmerge["mkvmerge"]

node_user -->|"submits URL"| node_app
node_app -->|"extracts ID"| node_url
node_tokens -->|"reads secret"| node_publicjs
node_tokens -->|"requests tokens"| node_authapi
node_app -->|"authenticates"| node_tokens
node_app -->|"requests stream"| node_playback
node_playback -->|"requests playback"| node_zeeapi
node_playback -->|"passes MPD"| node_manifest
node_playback -->|"fetches details"| node_metadata
node_manifest -->|"provides PSSH"| node_drm
node_drm -->|"creates challenge"| node_cdm
node_drm -->|"requests license"| node_license
node_cdm -->|"returns keys"| node_drm
node_app -->|"presents tracks"| node_selection
node_selection -->|"provides choices"| node_download
node_download -->|"downloads media"| node_nstream
node_download -->|"fallback download"| node_ytdlp
node_download -->|"fallback download"| node_ffmpeg
node_download -->|"passes media"| node_remux
node_remux -->|"remuxes tracks"| node_mkvmerge
node_remux -->|"produces MKV"| node_output

click node_app "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_url "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_tokens "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_playback "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_metadata "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_manifest "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_drm "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_selection "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_download "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py"
click node_remux "https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.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_url,node_tokens,node_playback,node_metadata,node_user toneBlue
class node_manifest,node_drm toneAmber
class node_app,node_selection,node_authapi,node_zeeapi,node_license toneMint
class node_download,node_remux,node_output toneRose
class node_publicjs,node_cdm,node_nstream,node_ytdlp,node_ffmpeg,node_mkvmerge toneIndigo
```

## Components

### Access and Discovery

- [Content ID](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`
- [Token Handling](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`
- [Playback Discovery](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`
- [Content Metadata](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`

### Media Preparation

- [MPD Parser](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`
- [Widevine Keys](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`

### User Interface

- [Downloader GUI](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`
- [Media Selection](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`

### Download and Output

- [Download Engine](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`
- [MKV Remux](https://github.com/arvind88765/zee5_downloader/blob/main/zee5_downloader.py): `zee5_downloader.py`
- **Final MKV**

### Other components

- **User**
- **Zee5 Public JS**
- **Zee5 Auth API**
- **Zee5 Playback API**
- **Local WVD CDM**
- **Zee5 License API**
- **N_m3u8DL-RE**
- **yt-dlp**
- **ffmpeg**
- **mkvmerge**

## Connections

- User → Downloader GUI: submits URL (evidence: `README.md`)
- Downloader GUI → Content ID: extracts ID (evidence: `README.md`)
- Token Handling → Zee5 Public JS: reads secret (evidence: `README.md`)
- Token Handling → Zee5 Auth API: requests tokens (evidence: `README.md`)
- Downloader GUI → Token Handling: authenticates (evidence: `README.md`)
- Downloader GUI → Playback Discovery: requests stream (evidence: `README.md`)
- Playback Discovery → Zee5 Playback API: requests playback (evidence: `README.md`)
- Playback Discovery → MPD Parser: passes MPD (evidence: `README.md`)
- Playback Discovery → Content Metadata: fetches details (evidence: `README.md`)
- MPD Parser → Widevine Keys: provides PSSH (evidence: `README.md`)
- Widevine Keys → Local WVD CDM: creates challenge (evidence: `README.md`)
- Widevine Keys → Zee5 License API: requests license (evidence: `README.md`)
- Local WVD CDM → Widevine Keys: returns keys (evidence: `README.md`)
- Downloader GUI → Media Selection: presents tracks (evidence: `README.md`)
- Media Selection → Download Engine: provides choices (evidence: `README.md`)
- Download Engine → N_m3u8DL-RE: downloads media (evidence: `README.md`)
- Download Engine → yt-dlp: fallback download (evidence: `README.md`)
- Download Engine → ffmpeg: fallback download (evidence: `README.md`)
- Download Engine → MKV Remux: passes media (evidence: `README.md`)
- MKV Remux → mkvmerge: remuxes tracks (evidence: `README.md`)
- MKV Remux → Final MKV: produces MKV (evidence: `README.md`)
