$ show HerbertHe/iptv-sources
This repository is an IPTV source aggregation and serving application. It fetches M3U playlists and EPG XML data from multiple upstream providers (e.g., epg.pw, iptv-org, fanmingming/live, YueChan/Live, etc.), applies filtering, deduplication, and format conversion, and outputs cleaned playlists, text-format channel lists, source metadata, and TV-box-compatible JSON files. The system includes a Koa-based web server that serves the generated files and provides an API for channel availability checking via an optional iptv-checker service. It is designed to run as a scheduled GitHub Action (every 2 hours) or as a Docker container, with a rollback mechanism that falls back to mirror sites if primary sources fail. The codebase is well-structured with clear separation of concerns, custom rule support for channel inclusion/exclusion and URL replacement, and comprehensive file output management. It is a monolith application with a data pipeline character, primarily targeting IPTV enthusiasts and self-hosters.
The LLM identified 2 files worth highlighting for reuse:
The Collector factory function provides a clean, reusable pattern for collecting key-value pairs with optional key and value filters. It maintains an internal Map of arrays, deduplicates values per key, and exposes a result method. This component is isolated (only imports from ./id) and can be extracted into any project that needs to aggregate and deduplicate data from multiple sources.
A self-contained function that converts an M3U playlist array into a TXT format grouped by channel group (using group-title from EXTINF lines). It handles parsing of EXTINF metadata and produces a text representation suitable for IPTV applications. This function is pure, has no internal dependencies, and can be directly reused in any IPTV-related project that needs to convert between playlist formats.