iptv-filter

Usage

usage: iptv-filter [-h] [--channel-exclude CHANNEL_EXCLUDE]
                   [--channel-include CHANNEL_INCLUDE]
                   [--group-exclude GROUP_EXCLUDE]
                   [--group-include GROUP_INCLUDE] [--min-height MIN_HEIGHT]
                   [-c CONFIG] [-i [INPUTS [INPUTS ...]]] [-I INTERVAL]
                   [-L LOG_LEVEL] [-n] [-o OUTPUT] [-r] [-R]
                   [-s [SORT_KEYS [SORT_KEYS ...]]]
                   [-t [TEMPLATES [TEMPLATES ...]]] [-T TIMEOUT] [-u UDPXY]
                   [-v]

optional arguments:
  -h, --help            show this help message and exit
  --channel-exclude CHANNEL_EXCLUDE
                        Channels to exclude with regex. Note: Blacklist has
                        higher priority than whitelist. (default: None)
  --channel-include CHANNEL_INCLUDE
                        Channels to include with regex. Note: Only channels in
                        the whitelist will be included if set. (default: None)
  --group-exclude GROUP_EXCLUDE
                        Groups to exclude with regex.Note: Blacklist has
                        higher priority than whitelist. (default: None)
  --group-include GROUP_INCLUDE
                        Groups to include with regex.Note: Only groups in the
                        whitelist will be included if set. (default: None)
  --min-height MIN_HEIGHT
                        Minimum height/resolution to accept, 0 means no
                        resolution filtering. (default: 0)
  -c CONFIG, --config CONFIG
                        Configuration file to unify title and id. (default:
                        config.json)
  -i [INPUTS [INPUTS ...]], --inputs [INPUTS [INPUTS ...]]
                        One or more input m3u playlist files/urls. (default:
                        ['https://iptv-org.github.io/iptv/index.m3u'])
  -I INTERVAL, --interval INTERVAL
                        Interval in seconds between successive fetching
                        requests. (default: 1)
  -L LOG_LEVEL, --log-level LOG_LEVEL
                        Log level. (default: INFO)
  -n, --skip-connectivity-check
                        Skip connectivity check. (default: False)
  -o OUTPUT, --output OUTPUT
                        Output file name. (default: iptvtools.m3u)
  -r, --replace-group-by-source
                        Flag to replace the group title with the source name,
                        where the source name is the basename of input
                        files/urls without extension. (default: False)
  -R, --resolution-on-title
                        Flag to append resolution such as 8K, 4K, 1080p, 720p
                        to the title. (default: False)
  -s [SORT_KEYS [SORT_KEYS ...]], --sort-keys [SORT_KEYS [SORT_KEYS ...]]
                        List of keys to sort the channels. Valid options
                        currently supported are `group-title`, `tvg-id`,
                        `template-order`, `height` and `title`. (default:
                        ['group-title', 'tvg-id', 'height', 'title'])
  -t [TEMPLATES [TEMPLATES ...]], --templates [TEMPLATES [TEMPLATES ...]]
                        Template m3u files/urls with well-maintained channel
                        information to replace the matched entries. (default:
                        [])
  -T TIMEOUT, --timeout TIMEOUT
                        Timeout threshold for fetching request. (default: 10)
  -u UDPXY, --udpxy UDPXY
                        UDP Proxy for certain IPTV channels. (default: None)
  -v, --version         show program's version number and exit

Example

There is a well-maintained IPTV list only for Beijing Unicom and a well-maintained templates & EPG mainly for China. So for me:

$ iptv-filter \
-i https://gist.githubusercontent.com/sdhzdmzzl/93cf74947770066743fff7c7f4fc5820/raw/11107d2dcfe2f5785e7ada94bb44c0cd349191c5/bj-unicom-iptv.m3u \
-t http://epg.51zmt.top:8000/test.m3u

With UDPXY, it becomes:

$ iptv-filter \
-i https://gist.githubusercontent.com/sdhzdmzzl/93cf74947770066743fff7c7f4fc5820/raw/11107d2dcfe2f5785e7ada94bb44c0cd349191c5/bj-unicom-iptv.m3u \
-t http://epg.51zmt.top:8000/test.m3u \
-u http://192.168.0.1:8888

Just replace http://192.168.0.1:8888 with corresponding UDPXY prefix should be OK.