# kdzm/channel architecture

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

- Interactive diagram: https://gitdiagram.com/kdzm/channel
- Repository: https://github.com/kdzm/channel

## Overview

This repository is a collection of Python scripts for discovering or resolving Chinese television and livestream URLs, rather than a single integrated application. The visible workflow is operator-run: a provider-specific script requests channel data and prints playable URLs; some scripts also write a player playlist or HTML. The modules cover national and regional broadcasters, streaming platforms, and live-streaming services. The excerpts show a shared HTTP helper and a few output-formatting paths. Many provider scripts were not sampled, so their internal calls and any common orchestration are not inferred.

Main entry points: [`requestget.py`](https://github.com/kdzm/channel/blob/master/requestget.py) (HTTP helper), [`山东电视台/爱青岛.py`](https://github.com/kdzm/channel/blob/master/%E5%B1%B1%E4%B8%9C%E7%94%B5%E8%A7%86%E5%8F%B0/%E7%88%B1%E9%9D%92%E5%B2%9B.py) (Qingdao TV), [`广州电视台/广州电视台.py`](https://github.com/kdzm/channel/blob/master/%E5%B9%BF%E5%B7%9E%E7%94%B5%E8%A7%86%E5%8F%B0/%E5%B9%BF%E5%B7%9E%E7%94%B5%E8%A7%86%E5%8F%B0.py) (Guangzhou TV), [`91看电视/91kds.py`](https://github.com/kdzm/channel/blob/master/91%E7%9C%8B%E7%94%B5%E8%A7%86/91kds.py) (91KDS channels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared helpers"]
  node_http["HTTP helper<br/>[requestget.py]"]
  node_signing["MD5 tokens<br/>[MD5.py]"]
  node_playlist["Playlist template<br/>[DPL频道列表模板.py]"]
  node_html["HTML conversion<br/>[converttohtml.py]"]
end

subgraph group_broadcasters["Broadcaster sources"]
  node_kds["91KDS channels<br/>[91kds.py]"]
  node_gx["Guangxi TV<br/>[gxtv.py]"]
  node_heilongjiang["Heilongjiang TV<br/>[hljtvGFY.py]"]
  node_qingdao["Qingdao TV<br/>[爱青岛.py]"]
  node_guangzhou["Guangzhou TV<br/>[广州电视台.py]"]
  node_provincial["Regional TV adapters"]
  node_telecom["Telecom IPTV tools"]
  node_epg["EPG and channel lists<br/>[EPG.py]"]
end

subgraph group_platforms["Streaming platforms"]
  node_migu["Migu video<br/>[mgchaclass.py]"]
  node_mgtv["Mango TV<br/>[mgtv.py]"]
  node_iqiyi["iQIYI<br/>[iqiyi.py]"]
  node_pptv["PPTV<br/>[pptv.py]"]
  node_platforms_more["Other platform adapters"]
end

subgraph group_live["Live services"]
  node_qq["Penguin esports<br/>[企鹅电竞.py]"]
  node_douyu["Douyu<br/>[斗鱼tv.py]"]
  node_huya["Huya<br/>[huyaTV.py]"]
  node_zhanqi["Zhanqi<br/>[游戏放映室.py]"]
end

node_operator(("Operator"))
node_provider_services{{"Provider services"}}
node_playlist_file["Playlist file"]
node_html_result["HTML output"]

node_operator -.->|"runs"| node_kds
node_operator -.->|"runs"| node_gx
node_operator -.->|"runs"| node_qingdao
node_operator -.->|"runs"| node_guangzhou
node_kds -->|"requests"| node_http
node_gx -->|"requests"| node_http
node_gx -->|"fetches channel data"| node_provider_services
node_kds -->|"resolves stream URLs"| node_provider_services
node_qingdao -->|"requests"| node_http
node_qingdao -->|"creates token"| node_signing
node_qingdao -->|"formats entries"| node_playlist
node_qingdao -->|"writes playlist"| node_playlist_file
node_guangzhou -->|"requests"| node_http
node_guangzhou -->|"formats entries"| node_playlist
node_guangzhou -->|"writes playlist"| node_playlist_file
node_qq -->|"requests"| node_http
node_qq -->|"formats entries"| node_playlist
node_migu -->|"requests"| node_http
node_migu -->|"creates token"| node_signing
node_mgtv -->|"requests"| node_http
node_heilongjiang -->|"requests"| node_http
node_heilongjiang -->|"creates token"| node_signing
node_telecom -->|"converts output"| node_html
node_html -->|"returns HTML"| node_html_result

click node_http "https://github.com/kdzm/channel/blob/master/requestget.py"
click node_signing "https://github.com/kdzm/channel/blob/master/MD5.py"
click node_playlist "https://github.com/kdzm/channel/blob/master/DPL%E9%A2%91%E9%81%93%E5%88%97%E8%A1%A8%E6%A8%A1%E6%9D%BF.py"
click node_html "https://github.com/kdzm/channel/blob/master/converttohtml.py"
click node_kds "https://github.com/kdzm/channel/blob/master/91%E7%9C%8B%E7%94%B5%E8%A7%86/91kds.py"
click node_gx "https://github.com/kdzm/channel/blob/master/%E5%B9%BF%E8%A5%BF%E5%AE%98%E7%BD%91/gxtv.py"
click node_heilongjiang "https://github.com/kdzm/channel/blob/master/%E9%BB%91%E9%BE%99%E6%B1%9F%E7%94%B5%E8%A7%86%E5%8F%B0/hljtvGFY.py"
click node_qingdao "https://github.com/kdzm/channel/blob/master/%E5%B1%B1%E4%B8%9C%E7%94%B5%E8%A7%86%E5%8F%B0/%E7%88%B1%E9%9D%92%E5%B2%9B.py"
click node_guangzhou "https://github.com/kdzm/channel/blob/master/%E5%B9%BF%E5%B7%9E%E7%94%B5%E8%A7%86%E5%8F%B0/%E5%B9%BF%E5%B7%9E%E7%94%B5%E8%A7%86%E5%8F%B0.py"
click node_provincial "https://github.com/kdzm/channel/tree/master/%E5%9B%9B%E5%B7%9D%E7%94%B5%E4%BF%A1"
click node_telecom "https://github.com/kdzm/channel/tree/master/%E5%B9%BF%E4%B8%9C%E7%94%B5%E4%BF%A1"
click node_epg "https://github.com/kdzm/channel/blob/master/%E5%AE%98%E6%96%B9%E9%A2%91%E9%81%93/EPG.py"
click node_migu "https://github.com/kdzm/channel/blob/master/%E5%92%AA%E5%92%95%E8%A7%86%E9%A2%91/mgchaclass.py"
click node_mgtv "https://github.com/kdzm/channel/blob/master/%E8%8A%92%E6%9E%9CTV/mgtv.py"
click node_iqiyi "https://github.com/kdzm/channel/blob/master/%E7%88%B1%E5%A5%87%E8%89%BA/iqiyi.py"
click node_pptv "https://github.com/kdzm/channel/blob/master/PPTV/pptv.py"
click node_platforms_more "https://github.com/kdzm/channel/tree/master/Bilibili"
click node_qq "https://github.com/kdzm/channel/blob/master/%E4%BC%81%E9%B9%85%E7%94%B5%E7%AB%9E/%E4%BC%81%E9%B9%85%E7%94%B5%E7%AB%9E.py"
click node_douyu "https://github.com/kdzm/channel/blob/master/%E6%96%97%E9%B1%BC%E7%9B%B4%E6%92%AD/%E6%96%97%E9%B1%BCtv.py"
click node_huya "https://github.com/kdzm/channel/blob/master/%E8%99%8E%E7%89%99TV/huyaTV.py"
click node_zhanqi "https://github.com/kdzm/channel/blob/master/%E6%88%98%E6%97%97%E7%9B%B4%E6%92%AD/%E6%B8%B8%E6%88%8F%E6%94%BE%E6%98%A0%E5%AE%A4.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_http,node_signing,node_playlist,node_html toneBlue
class node_kds,node_gx,node_heilongjiang,node_qingdao,node_guangzhou,node_provincial,node_telecom,node_epg toneAmber
class node_migu,node_mgtv,node_iqiyi,node_pptv,node_platforms_more toneMint
class node_qq,node_douyu,node_huya,node_zhanqi toneRose
class node_operator,node_provider_services,node_playlist_file,node_html_result toneIndigo
```

## Components

### Shared helpers

- [HTTP helper](https://github.com/kdzm/channel/blob/master/requestget.py): `requestget.py`
- [MD5 tokens](https://github.com/kdzm/channel/blob/master/MD5.py): `MD5.py`
- [Playlist template](https://github.com/kdzm/channel/blob/master/DPL%E9%A2%91%E9%81%93%E5%88%97%E8%A1%A8%E6%A8%A1%E6%9D%BF.py): `DPL频道列表模板.py`
- [HTML conversion](https://github.com/kdzm/channel/blob/master/converttohtml.py): `converttohtml.py`

### Broadcaster sources

- [91KDS channels](https://github.com/kdzm/channel/blob/master/91%E7%9C%8B%E7%94%B5%E8%A7%86/91kds.py): `91看电视/91kds.py`
- [Guangxi TV](https://github.com/kdzm/channel/blob/master/%E5%B9%BF%E8%A5%BF%E5%AE%98%E7%BD%91/gxtv.py): `广西官网/gxtv.py`
- [Heilongjiang TV](https://github.com/kdzm/channel/blob/master/%E9%BB%91%E9%BE%99%E6%B1%9F%E7%94%B5%E8%A7%86%E5%8F%B0/hljtvGFY.py): `黑龙江电视台/hljtvGFY.py`
- [Qingdao TV](https://github.com/kdzm/channel/blob/master/%E5%B1%B1%E4%B8%9C%E7%94%B5%E8%A7%86%E5%8F%B0/%E7%88%B1%E9%9D%92%E5%B2%9B.py): `山东电视台/爱青岛.py`
- [Guangzhou TV](https://github.com/kdzm/channel/blob/master/%E5%B9%BF%E5%B7%9E%E7%94%B5%E8%A7%86%E5%8F%B0/%E5%B9%BF%E5%B7%9E%E7%94%B5%E8%A7%86%E5%8F%B0.py): `广州电视台/广州电视台.py`
- [Regional TV adapters](https://github.com/kdzm/channel/tree/master/%E5%9B%9B%E5%B7%9D%E7%94%B5%E4%BF%A1): `四川电信`
- [Telecom IPTV tools](https://github.com/kdzm/channel/tree/master/%E5%B9%BF%E4%B8%9C%E7%94%B5%E4%BF%A1): `广东电信`
- [EPG and channel lists](https://github.com/kdzm/channel/blob/master/%E5%AE%98%E6%96%B9%E9%A2%91%E9%81%93/EPG.py): `官方频道/EPG.py`

### Streaming platforms

- [Migu video](https://github.com/kdzm/channel/blob/master/%E5%92%AA%E5%92%95%E8%A7%86%E9%A2%91/mgchaclass.py): `咪咕视频/mgchaclass.py`
- [Mango TV](https://github.com/kdzm/channel/blob/master/%E8%8A%92%E6%9E%9CTV/mgtv.py): `芒果TV/mgtv.py`
- [iQIYI](https://github.com/kdzm/channel/blob/master/%E7%88%B1%E5%A5%87%E8%89%BA/iqiyi.py): `爱奇艺/iqiyi.py`
- [PPTV](https://github.com/kdzm/channel/blob/master/PPTV/pptv.py): `PPTV/pptv.py`
- [Other platform adapters](https://github.com/kdzm/channel/tree/master/Bilibili): `Bilibili`

### Live services

- [Penguin esports](https://github.com/kdzm/channel/blob/master/%E4%BC%81%E9%B9%85%E7%94%B5%E7%AB%9E/%E4%BC%81%E9%B9%85%E7%94%B5%E7%AB%9E.py): `企鹅电竞/企鹅电竞.py`
- [Douyu](https://github.com/kdzm/channel/blob/master/%E6%96%97%E9%B1%BC%E7%9B%B4%E6%92%AD/%E6%96%97%E9%B1%BCtv.py): `斗鱼直播/斗鱼tv.py`
- [Huya](https://github.com/kdzm/channel/blob/master/%E8%99%8E%E7%89%99TV/huyaTV.py): `虎牙TV/huyaTV.py`
- [Zhanqi](https://github.com/kdzm/channel/blob/master/%E6%88%98%E6%97%97%E7%9B%B4%E6%92%AD/%E6%B8%B8%E6%88%8F%E6%94%BE%E6%98%A0%E5%AE%A4.py): `战旗直播/游戏放映室.py`

### Other components

- **Operator**
- **Provider services**
- **Playlist file**
- **HTML output**

## Connections

- Operator → 91KDS channels: runs
- Operator → Guangxi TV: runs
- Operator → Qingdao TV: runs
- Operator → Guangzhou TV: runs
- 91KDS channels → HTTP helper: requests (evidence: `91看电视/91kds.py`)
- Guangxi TV → HTTP helper: requests (evidence: `广西官网/gxtv.py`)
- Guangxi TV → Provider services: fetches channel data (evidence: `广西官网/gxtv.py`)
- 91KDS channels → Provider services: resolves stream URLs (evidence: `91看电视/91kds.py`)
- Qingdao TV → HTTP helper: requests (evidence: `山东电视台/爱青岛.py`)
- Qingdao TV → MD5 tokens: creates token (evidence: `山东电视台/爱青岛.py`)
- Qingdao TV → Playlist template: formats entries (evidence: `山东电视台/爱青岛.py`)
- Qingdao TV → Playlist file: writes playlist (evidence: `山东电视台/爱青岛.py`)
- Guangzhou TV → HTTP helper: requests (evidence: `广州电视台/广州电视台.py`)
- Guangzhou TV → Playlist template: formats entries (evidence: `广州电视台/广州电视台.py`)
- Guangzhou TV → Playlist file: writes playlist (evidence: `广州电视台/广州电视台.py`)
- Penguin esports → HTTP helper: requests (evidence: `企鹅电竞/企鹅电竞.py`)
- Penguin esports → Playlist template: formats entries (evidence: `企鹅电竞/企鹅电竞.py`)
- Migu video → HTTP helper: requests (evidence: `咪咕视频/mgchaclass.py`)
- Migu video → MD5 tokens: creates token (evidence: `咪咕视频/mgchaclass.py`)
- Mango TV → HTTP helper: requests (evidence: `芒果TV/mgtv.py`)
- Heilongjiang TV → HTTP helper: requests (evidence: `黑龙江电视台/hljtvGFY.py`)
- Heilongjiang TV → MD5 tokens: creates token (evidence: `黑龙江电视台/hljtvGFY.py`)
- Telecom IPTV tools → HTML conversion: converts output (evidence: `广东电信/广东电信IPTV2.py`)
- HTML conversion → HTML output: returns HTML (evidence: `converttohtml.py`)
