# fanmingming/live architecture

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

- Interactive diagram: https://gitdiagram.com/fanmingming/live
- Repository: https://github.com/fanmingming/live

## Overview

This repository is a static TV/radio logo and playlist resource site with browser-based media tools and edge handlers. Users browse logos or playlists, subscribe with a player, convert playlist text, download M3U8 media, or request guide and radio data. The graph preserves the documented product branches and sampled runtime layers; some pages and playlist formats are unsampled, so their internal wiring is not inferred.

Main entry points: [`tv/m3u`](https://github.com/fanmingming/live/tree/main/tv/m3u) (TV playlists), [`worker/radio.js`](https://github.com/fanmingming/live/blob/main/worker/radio.js) (Radio handler), [`m3u8/stream-saver.js`](https://github.com/fanmingming/live/blob/main/m3u8/stream-saver.js) (Stream writer), [`player/index.html`](https://github.com/fanmingming/live/blob/main/player/index.html) (HLS web player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Channel library"]
  node_tvlogos["TV logos"]
  node_radiologos["Radio logos"]
  node_tvplaylists["TV playlists"]
  node_radioplaylists["Radio playlists"]
  node_guidexml["Guide XML<br/>[e.xml]"]
end

subgraph group_playback["Playback tools"]
  node_webplayer["HLS web player<br/>[index.html]"]
  node_playerlogic["Player source loader<br/>[player.js]"]
  node_hlsplayer["HLS player page<br/>[hls.html]"]
end

subgraph group_conversion["Playlist conversion"]
  node_txtconverter["TXT to M3U<br/>[index.html]"]
end

subgraph group_services["Guide and radio services"]
  node_epgworker["EPG handler<br/>[epg.js]"]
  node_radioworker["Radio handler<br/>[radio.js]"]
  node_radiom3u["Radio stream list<br/>[radio.m3u]"]
end

subgraph group_download["M3U8 download internals"]
  node_m3u8tool["M3U8 downloader<br/>[index.html]"]
  node_mitm["Download transporter<br/>[mitm.html]"]
  node_streamsaver["Stream writer<br/>[stream-saver.js]"]
  node_serviceworker["Download worker<br/>[serviceworker.js]"]
  node_aes["AES decryptor<br/>[aes-decryptor.js]"]
  node_mux["MP4 transmuxer<br/>[mux-mp4.js]"]
  node_vue["Vue runtime<br/>[vue.js]"]
end

node_visitor(("Site user"))
node_guidefeed[("EPG JSON feed")]
node_radioapi["Radio API"]
node_mediauser(("Media subscriber"))

node_visitor -->|"browses"| node_tvlogos
node_visitor -->|"browses"| node_radiologos
node_visitor -->|"downloads"| node_tvplaylists
node_visitor -->|"downloads"| node_radioplaylists
node_visitor -->|"opens"| node_webplayer
node_visitor -->|"converts text"| node_txtconverter
node_visitor -->|"downloads stream"| node_m3u8tool
node_visitor -->|"requests guide"| node_epgworker
node_visitor -.->|"requests radio"| node_radioworker
node_mediauser -->|"subscribes"| node_tvplaylists
node_tvplaylists -->|"references guide"| node_guidexml
node_mediauser -->|"plays stream"| node_webplayer
node_webplayer -->|"loads source"| node_playerlogic
node_playerlogic -.->|"uses HLS fallback"| node_hlsplayer
node_txtconverter -->|"produces format"| node_tvplaylists
node_m3u8tool -.->|"downloads via"| node_streamsaver
node_streamsaver -->|"sends messages"| node_mitm
node_streamsaver -->|"transfers stream"| node_serviceworker
node_serviceworker -->|"serves download"| node_mitm
node_epgworker -->|"fetches feed"| node_guidefeed
node_radioworker -->|"requests program"| node_radioapi
node_radioworker -.->|"redirects stream"| node_radiom3u

click node_tvlogos "https://github.com/fanmingming/live/tree/main/tv"
click node_radiologos "https://github.com/fanmingming/live/tree/main/radio"
click node_tvplaylists "https://github.com/fanmingming/live/tree/main/tv/m3u"
click node_radioplaylists "https://github.com/fanmingming/live/tree/main/radio/m3u"
click node_guidexml "https://github.com/fanmingming/live/blob/main/e.xml"
click node_webplayer "https://github.com/fanmingming/live/blob/main/player/index.html"
click node_playerlogic "https://github.com/fanmingming/live/blob/main/player/player.js"
click node_hlsplayer "https://github.com/fanmingming/live/blob/main/player/hls.html"
click node_txtconverter "https://github.com/fanmingming/live/blob/main/txt2m3u/index.html"
click node_m3u8tool "https://github.com/fanmingming/live/blob/main/m3u8/index.html"
click node_mitm "https://github.com/fanmingming/live/blob/main/m3u8/mitm.html"
click node_streamsaver "https://github.com/fanmingming/live/blob/main/m3u8/stream-saver.js"
click node_serviceworker "https://github.com/fanmingming/live/blob/main/m3u8/serviceworker.js"
click node_aes "https://github.com/fanmingming/live/blob/main/m3u8/aes-decryptor.js"
click node_mux "https://github.com/fanmingming/live/blob/main/m3u8/mux-mp4.js"
click node_vue "https://github.com/fanmingming/live/blob/main/m3u8/vue.js"
click node_epgworker "https://github.com/fanmingming/live/blob/main/worker/epg.js"
click node_radioworker "https://github.com/fanmingming/live/blob/main/worker/radio.js"
click node_radiom3u "https://github.com/fanmingming/live/blob/main/worker/radio.m3u"

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_tvlogos,node_radiologos,node_tvplaylists,node_radioplaylists,node_guidexml,node_visitor toneBlue
class node_webplayer,node_playerlogic,node_hlsplayer,node_guidefeed toneAmber
class node_txtconverter,node_radioapi toneMint
class node_epgworker,node_radioworker,node_radiom3u toneRose
class node_m3u8tool,node_mitm,node_streamsaver,node_serviceworker,node_aes,node_mux,node_vue,node_mediauser toneIndigo
```

## Components

### Channel library

- [TV logos](https://github.com/fanmingming/live/tree/main/tv): `tv`
- [Radio logos](https://github.com/fanmingming/live/tree/main/radio): `radio`
- [TV playlists](https://github.com/fanmingming/live/tree/main/tv/m3u): `tv/m3u`
- [Radio playlists](https://github.com/fanmingming/live/tree/main/radio/m3u): `radio/m3u`
- [Guide XML](https://github.com/fanmingming/live/blob/main/e.xml): `e.xml`

### Playback tools

- [HLS web player](https://github.com/fanmingming/live/blob/main/player/index.html): `player/index.html`
- [Player source loader](https://github.com/fanmingming/live/blob/main/player/player.js): `player/player.js`
- [HLS player page](https://github.com/fanmingming/live/blob/main/player/hls.html): `player/hls.html`

### Playlist conversion

- [TXT to M3U](https://github.com/fanmingming/live/blob/main/txt2m3u/index.html): `txt2m3u/index.html`

### Guide and radio services

- [EPG handler](https://github.com/fanmingming/live/blob/main/worker/epg.js): `worker/epg.js`
- [Radio handler](https://github.com/fanmingming/live/blob/main/worker/radio.js): `worker/radio.js`
- [Radio stream list](https://github.com/fanmingming/live/blob/main/worker/radio.m3u): `worker/radio.m3u`

### M3U8 download internals

- [M3U8 downloader](https://github.com/fanmingming/live/blob/main/m3u8/index.html): `m3u8/index.html`
- [Download transporter](https://github.com/fanmingming/live/blob/main/m3u8/mitm.html): `m3u8/mitm.html`
- [Stream writer](https://github.com/fanmingming/live/blob/main/m3u8/stream-saver.js): `m3u8/stream-saver.js`
- [Download worker](https://github.com/fanmingming/live/blob/main/m3u8/serviceworker.js): `m3u8/serviceworker.js`
- [AES decryptor](https://github.com/fanmingming/live/blob/main/m3u8/aes-decryptor.js): `m3u8/aes-decryptor.js`
- [MP4 transmuxer](https://github.com/fanmingming/live/blob/main/m3u8/mux-mp4.js): `m3u8/mux-mp4.js`
- [Vue runtime](https://github.com/fanmingming/live/blob/main/m3u8/vue.js): `m3u8/vue.js`

### Other components

- **Site user**
- **EPG JSON feed**
- **Radio API**
- **Media subscriber**

## Connections

- Site user → TV logos: browses (evidence: `README.md`)
- Site user → Radio logos: browses (evidence: `README.md`)
- Site user → TV playlists: downloads (evidence: `README.md`)
- Site user → Radio playlists: downloads (evidence: `README.md`)
- Site user → HLS web player: opens (evidence: `README.md`)
- Site user → TXT to M3U: converts text (evidence: `README.md`)
- Site user → M3U8 downloader: downloads stream (evidence: `README.md`)
- Site user → EPG handler: requests guide (evidence: `README.md`)
- Site user → Radio handler: requests radio
- Media subscriber → TV playlists: subscribes (evidence: `README.md`)
- TV playlists → Guide XML: references guide (evidence: `README.md`)
- Media subscriber → HLS web player: plays stream (evidence: `README.md`)
- HLS web player → Player source loader: loads source (evidence: `player/player.js`)
- Player source loader → HLS player page: uses HLS fallback
- TXT to M3U → TV playlists: produces format (evidence: `README.md`)
- M3U8 downloader → Stream writer: downloads via
- Stream writer → Download transporter: sends messages (evidence: `m3u8/stream-saver.js`)
- Stream writer → Download worker: transfers stream (evidence: `m3u8/stream-saver.js`)
- Download worker → Download transporter: serves download (evidence: `m3u8/serviceworker.js`)
- EPG handler → EPG JSON feed: fetches feed (evidence: `worker/epg.js`)
- Radio handler → Radio API: requests program (evidence: `worker/radio.js`)
- Radio handler → Radio stream list: redirects stream
