diff --git a/README.md b/README.md index b81f886..ecabe4d 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,8 @@ GET /m3u - `wanted_groups` (optional): A comma-separated list of group names to include (takes precedence over unwanted_groups) - `nostreamproxy` (optional): Set to 'true' to disable stream proxying - `proxy_url` (optional): Custom base URL for proxied content (overrides auto-detection) -- `include_channel_id` (optional): Set to 'true' to include `channel-id` in M3U, useful for [Channels](https://getchannels.com) +- `include_channel_id` (optional): Set to 'true' to include `epg_channel_id` in M3U, useful for [Channels](https://getchannels.com) +- `channel_id_tag` (optional): Name of the tag to use for `epg_channel_id` data in M3U, defaults to `channel-id` Note: For `unwanted_groups` and `wanted_groups`, you can use wildcard patterns with `*` and `?` characters. For example: - `US*` will match all groups starting with "US" diff --git a/run.py b/run.py index 5d6d39a..bbe5a27 100644 --- a/run.py +++ b/run.py @@ -618,6 +618,7 @@ def generate_m3u(): no_stream_proxy = str(data.get("nostreamproxy", "")).lower() == "true" include_vod = str(data.get("include_vod", "false")).lower() == "true" include_channel_id = str(data.get("include_channel_id", "false")).lower() == "true" + channel_id_tag = str(data.get("channel_id_tag", "channel-id")) logger.info("🔄 Processing POST request for M3U generation") else: unwanted_groups = parse_group_list(request.args.get("unwanted_groups", "")) @@ -625,6 +626,7 @@ def generate_m3u(): no_stream_proxy = request.args.get("nostreamproxy", "").lower() == "true" include_vod = request.args.get("include_vod", "false").lower() == "true" include_channel_id = request.args.get("include_channel_id", "false") == "true" + channel_id_tag = request.args.get("channel_id_tag", "channel-id") logger.info("🔄 Processing GET request for M3U generation") # For M3U generation, warn about VOD performance impact @@ -741,7 +743,7 @@ def generate_m3u(): if include_channel_id: channel_id = stream.get("epg_channel_id") if channel_id: - tags.append(f'channel-id="{channel_id}"') + tags.append(f'{channel_id_tag}="{channel_id}"') # Create the stream URL based on content type if content_type == "live":