This article was last updated on 2025-08-25 16:00.

[中文版本]

Rainbow IPTV Source Filter is a tool for filtering IPTV sources. It can detect and filter out unreachable or poor-quality sources, and merge the available sources into a specified output file.

⚠️ Notes

  1. This tool is designed to perform local availability tests on live sources within the same network environment as the IPTV playback device, and to merge the filtered valid sources into a target file. Please do not use this tool in scenarios involving cloud servers or environments that do not match the playback device’s network.
  2. By default, the tool uses Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 as the User-Agent (UA) for testing access. To modify it, please set a custom UA in the configuration file. If the default UA is used, you may need to adjust the player’s UA settings to ensure compatibility when playing the filtered sources (e.g., Tianguang Yinying player).

⚠️ Disclaimer

  1. This tool is for learning and research purposes only. Please do not use it for illegal purposes. Copying, modifying, and selling the tool commercially is strictly prohibited.
  2. All live sources in the project come from the internet. If there is any infringement, please contact the author for removal.

📦 Installation

If you have Golang installed, you can quickly install the tool with the following command:

1
go install github.com/rambollwong/rainbow-iptv-source-filter/cmd/rainbow-iptv-source-filterd@latest

Use Precompiled Binary

If Go is not installed, you can download the binary file suitable for your system from GitHub Releases.

🚀 Usage

After installation, you can start the program with the following commands:

1
2
3
4
5
# Linux or macOS
rainbow-iptv-source-filterd -c ./conf

# Windows
rainbow-iptv-source-filterd.exe -c ./conf

Configuration File Preparation

Before running, please create a configuration file named config.yaml in the ./conf directory. For configuration details, please refer to the Configuration File Description below.

Running Log Example

If the configuration is correct, the program will start running and output logs, as shown below:

During the running process, red ERR logs may appear. As long as the program does not exit, this is normal.
After the program finishes running, it will output the message All Done..

⚙️ Configuration File Description

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
programListSourceUrls: # List of network live sources, multiple sources supported, both `.m3u` and `.txt` formats are supported
- https://raw.githubusercontent.com/kimwang1978/collect-tv-txt/refs/heads/main/bbxx_lite.m3u
- https://raw.githubusercontent.com/Guovin/iptv-api/gd/output/result.m3u
- https://raw.githubusercontent.com/yuanzl77/IPTV/main/live.m3u
programListSourceFileLocalPath: path/to/local/files # Directory of local live source files
outputFile: ./output/result.m3u8 # Output file path. The tool will determine the output file format based on the file extension. Both `.m3u` and `.txt` formats are supported, with `.m3u` as the default.
testPingMinLatency: 5000 # Minimum access latency for each program list address (unit: ms)
testLoadMinSpeed: 800 # Minimum read speed for each live source (unit: kb/s), sources below this value will be filtered out
retryTimes: 3 # Number of retries after access failure
customUA: # Custom User-Agent (optional)
parallelExecutorNum: 50 # Number of concurrent test threads, adjustable based on computer performance and network bandwidth
groupList: # Custom channel groups, only channels defined here will be tested
- group: 央视 # Group name
tvgName: # Channel list (avoid duplicates)
- CCTV1,CCTV1综合 # Supports merging multiple channel names, compatible with different live source naming conventions through this method, ultimately outputting the leftmost channel name to the final file
- CCTV2,CCTV2财经
- CCTV3,CCTV3综艺
- CCTV4,CCTV4中文国际
- CCTV5,CCTV5体育
- CCTV5+,CCTV5+体育赛事
- CCTV6,CCTV6电影
- CCTV7,CCTV7国防军事,CCTV7军事
- CCTV8,CCTV8电视剧
- CCTV9,CCTV9纪录
- CCTV10,CCTV10科教
- CCTV11,CCTV11戏曲
- CCTV12,CCTV12社会与法
- CCTV13,CCTV13新闻
- CCTV14,CCTV14少儿
- CCTV15,CCTV15音乐
- CCTV16,CCTV16-MST
- CCTV17,CCTV17农业农村
- CCTV4K,CCTV4KMXW
- CCTV8K,CCTV8KMCP
- group: 卫视
tvgName:
- 北京卫视
- 江苏卫视
- 浙江卫视
- 湖南卫视
- 东方卫视
- 辽宁卫视
- 天津卫视
- 黑龙江卫视
- 广东卫视
- 深圳卫视
- 山东卫视
- 四川卫视
- 安徽卫视
- 东南卫视
- 福建卫视
- 贵州卫视
- 云南卫视
- 河南卫视
- 重庆卫视
- 湖北卫视
- 江西卫视
- 广西卫视
- 河北卫视
- 山西卫视
- 陕西卫视
- 海南卫视
- 吉林卫视
- 内蒙古卫视
- 新疆卫视
- 西藏卫视
- 宁夏卫视
- 甘肃卫视
- 青海卫视
- 厦门卫视
hostCustomUA: # Custom UA settings for specific domains/addresses
- mursor.ottiptv.cc -> okHttp/Mod-1.0.1

# Log Configuration (recommended to keep default if no special requirements)
# For details, please refer to rainbowlog: https://github.com/rambollwong/rainbowlog
rainbowlog:
enable: true # enable logger
level: INFO # default logger level
label: "" # default logger label, if empty, will not record the label
stack: false # whether print stack
enableConsolePrinting: true # whether print log record to console
enableRainbowConsole: true # whether using rainbow colors when printing to console
timeFormat: # the time format of the time in each record, e.g. 'UNIX' or 'UNIXMS' or 'UNIXMICRO' or 'UNIXNANO' or '2006-01-02 15:04:05.000'
sizeRollingFileConfig:
enable: false # enable size rolling file
logFilePath: ./log # the path of log files
logFileBaseName: rainbow.iptv.source.filter.log # the base name of log file
maxBackups: 10 # max log file backups, if it is negative, the file rotating will be disabled
fileSizeLimit: 100M # the max size of each log file, it is valid when MaxBackups is not negative
encoder: txt # specify the log information format of the log file, 'txt' and 'json' supported.
timeRollingFileConfig:
enable: false # enable time rolling file
logFilePath: ./log # the path of log files
logFileBaseName: rainbow.iptv.source.filter.log # the base name of log file
maxBackups: 7 # max log file backups, if it is negative, the file rotating will be disabled
rollingPeriod: DAY # the rolling time period for rotating log file, e.g. 'YEAR' or 'MONTH' or 'DAY' or 'HOUR' or 'MINUTE' or 'SECOND'
encoder: txt # specify the log information format of the log file, 'txt' and 'json' supported.

Implementation Details

  1. During the testing process, the tool automatically filters out sources whose URLs contain the keyword audio. This is because such sources are typically audio streams rather than video live streams, which do not align with the intended use case of this tool.
  2. In the current version, if a source’s tvg-name does not match its title, that source will also be filtered out. This behavior will be adjusted in future versions, where tvg-name will be used uniformly as the matching standard.
  3. All channel names tvg-name will be converted to uppercase, and the - character will be removed.

📬 Contact Us

🙏 Acknowledgments

Thanks to the following repositories for providing live source data support:

💰 Support with a Donation

If you like this project, feel free to buy the author a cup of lemonade ☕️. Your support is my motivation for continuous updates!

  • WeChat Pay:
  • Alipay: