# githubofhimanshu/iptv architecture

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

- Interactive diagram: https://gitdiagram.com/githubofhimanshu/iptv
- Repository: https://github.com/githubofhimanshu/iptv

## Overview

This repository curates publicly available IPTV stream links and produces M3U playlists for video players. Its central product workflow is to load channel metadata and stream records, enrich and validate stream entries, then generate public playlists and supporting indexes. It also supports issue-driven playlist updates, validation and reporting, plus README tables. The supplied excerpts show parts of data loading, parsing and generation; several command and generator implementations are unsampled, so their internal links are not inferred.

Main entry points: [`scripts/api.ts`](https://github.com/githubofhimanshu/iptv/blob/master/scripts/api.ts) (Metadata loader), [`scripts/models/stream.ts`](https://github.com/githubofhimanshu/iptv/blob/master/scripts/models/stream.ts) (Stream model), [`scripts/commands/playlist/update.ts`](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/update.ts) (Issue-driven updates), [`scripts/core/playlistParser.ts`](https://github.com/githubofhimanshu/iptv/blob/master/scripts/core/playlistParser.ts) (M3U parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Metadata and streams"]
  node_api["Metadata loader<br/>[api.ts]"]
  node_stream["Stream model<br/>[stream.ts]"]
  node_playlistmodel["Playlist model<br/>[playlist.ts]"]
  node_parser["M3U parser<br/>[playlistParser.ts]"]
  node_core["Parsing utilities"]
end

subgraph group_operations["Playlist operations"]
  node_update["Issue-driven updates<br/>[update.ts]"]
  node_validate["Playlist validation<br/>[validate.ts]"]
  node_edit["Playlist editing<br/>[edit.ts]"]
  node_export["Playlist export<br/>[export.ts]"]
  node_format["Playlist formatting<br/>[format.ts]"]
end

subgraph group_outputs["Playlist publishing"]
  node_generate["Playlist generation<br/>[generate.ts]"]
  node_geo["Geographic playlists"]
  node_language["Language playlists"]
  node_othergenerators["Other indexes"]
end

subgraph group_support["Reports and tables"]
  node_readme["README tables<br/>[update.ts]"]
  node_tables["Country and language tables"]
  node_report["Request report<br/>[create.ts]"]
end

node_player(("Video player"))
node_database[("iptv-org database")]
node_sdk["IPTV SDK"]

node_player -->|"uses playlists"| node_generate
node_database -->|"provides channel data"| node_api
node_api -->|"loads and processes"| node_sdk
node_api -->|"supplies metadata"| node_stream
node_parser -->|"creates streams"| node_stream
node_update -->|"parses playlists"| node_parser
node_update -->|"edits and validates"| node_stream
node_update -->|"loads metadata"| node_api
node_update -->|"serializes playlists"| node_playlistmodel
node_report -->|"loads metadata"| node_api
node_report -->|"parses playlists"| node_parser
node_geo -->|"builds playlists"| node_playlistmodel
node_geo -->|"groups streams"| node_stream
node_language -->|"builds playlists"| node_playlistmodel
node_language -->|"selects streams"| node_stream
node_readme -->|"updates tables"| node_tables

click node_api "https://github.com/githubofhimanshu/iptv/blob/master/scripts/api.ts"
click node_stream "https://github.com/githubofhimanshu/iptv/blob/master/scripts/models/stream.ts"
click node_playlistmodel "https://github.com/githubofhimanshu/iptv/blob/master/scripts/models/playlist.ts"
click node_parser "https://github.com/githubofhimanshu/iptv/blob/master/scripts/core/playlistParser.ts"
click node_core "https://github.com/githubofhimanshu/iptv/tree/master/scripts/core"
click node_update "https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/update.ts"
click node_validate "https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/validate.ts"
click node_edit "https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/edit.ts"
click node_export "https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/export.ts"
click node_format "https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/format.ts"
click node_generate "https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/generate.ts"
click node_geo "https://github.com/githubofhimanshu/iptv/tree/master/scripts/generators"
click node_language "https://github.com/githubofhimanshu/iptv/blob/master/scripts/generators/languagesGenerator.ts"
click node_othergenerators "https://github.com/githubofhimanshu/iptv/tree/master/scripts/generators"
click node_readme "https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/readme/update.ts"
click node_tables "https://github.com/githubofhimanshu/iptv/tree/master/scripts/tables"
click node_report "https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/report/create.ts"

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_api,node_stream,node_playlistmodel,node_parser,node_core toneBlue
class node_update,node_validate,node_edit,node_export,node_format,node_database toneAmber
class node_generate,node_geo,node_language,node_othergenerators toneMint
class node_readme,node_tables,node_report toneRose
class node_player,node_sdk toneIndigo
```

## Components

### Metadata and streams

- [Metadata loader](https://github.com/githubofhimanshu/iptv/blob/master/scripts/api.ts): `scripts/api.ts`
- [Stream model](https://github.com/githubofhimanshu/iptv/blob/master/scripts/models/stream.ts): `scripts/models/stream.ts`
- [Playlist model](https://github.com/githubofhimanshu/iptv/blob/master/scripts/models/playlist.ts): `scripts/models/playlist.ts`
- [M3U parser](https://github.com/githubofhimanshu/iptv/blob/master/scripts/core/playlistParser.ts): `scripts/core/playlistParser.ts`
- [Parsing utilities](https://github.com/githubofhimanshu/iptv/tree/master/scripts/core): `scripts/core`

### Playlist operations

- [Issue-driven updates](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/update.ts): `scripts/commands/playlist/update.ts`
- [Playlist validation](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/validate.ts): `scripts/commands/playlist/validate.ts`
- [Playlist editing](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/edit.ts): `scripts/commands/playlist/edit.ts`
- [Playlist export](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/export.ts): `scripts/commands/playlist/export.ts`
- [Playlist formatting](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/format.ts): `scripts/commands/playlist/format.ts`

### Playlist publishing

- [Playlist generation](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/playlist/generate.ts): `scripts/commands/playlist/generate.ts`
- [Geographic playlists](https://github.com/githubofhimanshu/iptv/tree/master/scripts/generators): `scripts/generators`
- [Language playlists](https://github.com/githubofhimanshu/iptv/blob/master/scripts/generators/languagesGenerator.ts): `scripts/generators/languagesGenerator.ts`
- [Other indexes](https://github.com/githubofhimanshu/iptv/tree/master/scripts/generators): `scripts/generators`

### Reports and tables

- [README tables](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/readme/update.ts): `scripts/commands/readme/update.ts`
- [Country and language tables](https://github.com/githubofhimanshu/iptv/tree/master/scripts/tables): `scripts/tables`
- [Request report](https://github.com/githubofhimanshu/iptv/blob/master/scripts/commands/report/create.ts): `scripts/commands/report/create.ts`

### Other components

- **Video player**
- **iptv-org database**
- **IPTV SDK**

## Connections

- Video player → Playlist generation: uses playlists (evidence: `README.md`)
- iptv-org database → Metadata loader: provides channel data (evidence: `README.md`)
- Metadata loader → IPTV SDK: loads and processes (evidence: `scripts/api.ts`)
- Metadata loader → Stream model: supplies metadata (evidence: `scripts/models/stream.ts`)
- M3U parser → Stream model: creates streams (evidence: `scripts/core/playlistParser.ts`)
- Issue-driven updates → M3U parser: parses playlists (evidence: `scripts/commands/playlist/update.ts`)
- Issue-driven updates → Stream model: edits and validates (evidence: `scripts/commands/playlist/update.ts`)
- Issue-driven updates → Metadata loader: loads metadata (evidence: `scripts/commands/playlist/update.ts`)
- Issue-driven updates → Playlist model: serializes playlists (evidence: `scripts/commands/playlist/update.ts`)
- Request report → Metadata loader: loads metadata (evidence: `scripts/commands/report/create.ts`)
- Request report → M3U parser: parses playlists (evidence: `scripts/commands/report/create.ts`)
- Geographic playlists → Playlist model: builds playlists (evidence: `scripts/generators/countriesGenerator.ts`)
- Geographic playlists → Stream model: groups streams (evidence: `scripts/generators/countriesGenerator.ts`)
- Language playlists → Playlist model: builds playlists (evidence: `scripts/generators/languagesGenerator.ts`)
- Language playlists → Stream model: selects streams (evidence: `scripts/generators/languagesGenerator.ts`)
- README tables → Country and language tables: updates tables (evidence: `scripts/commands/readme/update.ts`)
