franek
121b9cce15
fix: first channel without category
due to dynamic playlist changing, enumerate() wasn't working properly
M3U Category Matcher
Do you have IPTV provider who doesn't add groups to channels, but uses channel names for it? This script will attach "channel-like" categories to channels under them. Example:
You have these 5 channels:
- ### GENERAL ###
- TV1 HD
- TV2 HD
- ### MUSIC ###
- METAL LIVE TV HD
For example, if you provided \#\#\# (.*) \#\#\#
regex:
This script will remove channel with no. 1. and 5., then attach categories:
- GENERAL (matched group from regex!) to channels 2, 3,
- MUSIC to channel 5.
NOTE!
This script is in BETA phase. Please report any bugs!
Based on
- argparse
- pathlib
- re
- ipytv
Usage
python3 <path-to-script> -i "<m3u path>" -r "<regex to match>" (-v)
Result
When everything is done, file is OVERWRITTEN!
Example usage
python3 <path-to-script> -i "m3u_list.m3u" -r "\#\#\# (.*) \#\#\#"
Available parameters
- -i/--input - absolute path to m3u+ file
- -r/--regex - regular expression used to match categories in channel names
- -v/--verbose - enable verbose mode
Languages
Python
100%