mirror of
https://github.com/ovosimpatico/xtream2m3u.git
synced 2026-01-15 16:32:55 -03:00
Add support for customising the M3U tag name for EPG channel id
This commit is contained in:
@@ -118,7 +118,8 @@ GET /m3u
|
|||||||
- `wanted_groups` (optional): A comma-separated list of group names to include (takes precedence over unwanted_groups)
|
- `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
|
- `nostreamproxy` (optional): Set to 'true' to disable stream proxying
|
||||||
- `proxy_url` (optional): Custom base URL for proxied content (overrides auto-detection)
|
- `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:
|
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"
|
- `US*` will match all groups starting with "US"
|
||||||
|
|||||||
4
run.py
4
run.py
@@ -618,6 +618,7 @@ def generate_m3u():
|
|||||||
no_stream_proxy = str(data.get("nostreamproxy", "")).lower() == "true"
|
no_stream_proxy = str(data.get("nostreamproxy", "")).lower() == "true"
|
||||||
include_vod = str(data.get("include_vod", "false")).lower() == "true"
|
include_vod = str(data.get("include_vod", "false")).lower() == "true"
|
||||||
include_channel_id = str(data.get("include_channel_id", "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")
|
logger.info("🔄 Processing POST request for M3U generation")
|
||||||
else:
|
else:
|
||||||
unwanted_groups = parse_group_list(request.args.get("unwanted_groups", ""))
|
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"
|
no_stream_proxy = request.args.get("nostreamproxy", "").lower() == "true"
|
||||||
include_vod = request.args.get("include_vod", "false").lower() == "true"
|
include_vod = request.args.get("include_vod", "false").lower() == "true"
|
||||||
include_channel_id = request.args.get("include_channel_id", "false") == "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")
|
logger.info("🔄 Processing GET request for M3U generation")
|
||||||
|
|
||||||
# For M3U generation, warn about VOD performance impact
|
# For M3U generation, warn about VOD performance impact
|
||||||
@@ -741,7 +743,7 @@ def generate_m3u():
|
|||||||
if include_channel_id:
|
if include_channel_id:
|
||||||
channel_id = stream.get("epg_channel_id")
|
channel_id = stream.get("epg_channel_id")
|
||||||
if 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
|
# Create the stream URL based on content type
|
||||||
if content_type == "live":
|
if content_type == "live":
|
||||||
|
|||||||
Reference in New Issue
Block a user