Appearance
EPG sources and mapping
The EPG is the TV guide: what is on now and next. Bitstream reads XMLTV files from EPG sources, matches their channels to your streams, and serves the guide to apps through xmltv.php and player_api.php.
1. Add an EPG source
In the panel, open EPG, then Sources, and click Add source.
- XMLTV URL: the link your guide provider gives you. Plain XML or gzip both work.
- Refresh: every hour, 6 hours, 12 hours or every day.
- Days to keep: how many days of old programmes to keep.
- Priority: when two sources have the same channel, the higher number wins.
The first refresh starts as soon as you save. The list shows the last refresh, its status and how many channels the source has. Click Refresh now to fetch it again without waiting.
A broken or half downloaded file never wipes your guide. Bitstream keeps the previous data until a refresh succeeds.
Automate it
bash
curl -s -X POST $PANEL/epg/sources \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"name": "My guide",
"url": "https://epg.example.com/guide.xml.gz",
"refresh_interval": "PT12H",
"days_to_keep": 7,
"priority": 10
}' | jq '{id}'
curl -s -X POST $PANEL/epg/sources/1/refresh -H "Authorization: Bearer $TOKEN"refresh_interval is an ISO 8601 duration. PT12H is every 12 hours. The minimum is PT15M.
2. Map streams to EPG channels
Open EPG, then Channel mapping. Each stream shows its guide channel, or Not mapped.
- Click Match all automatically to match every unmapped stream. Only strong matches (85% or more) are applied. Names are compared without accents, quality tags like
HDandFHD, and country prefixes. - For the rest, accept a Suggestion, or search the guide channel yourself and pick it.
You can also set it when you edit a stream, in the EPG channel field of Basics.
New streams are not matched on their own yet. Run Match all automatically again after you add channels.
Automate it
Ask for suggestions first. With apply: false nothing changes. Without stream_ids it looks at every stream with no mapping yet:
bash
curl -s -X POST $PANEL/epg/mapping/auto \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"min_score": 0.85, "apply": false}' | jqIf they look right, send the same request with "apply": true.
Set one by hand. First find the EPG channel, then map it:
bash
curl -s "$PANEL/epg/channels?q=sport" -H "Authorization: Bearer $TOKEN" | jq '.data[] | {id, name}'
curl -s -X PUT $PANEL/epg/mapping \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"mappings": [{"stream_id": 101, "epg_channel_id": 3021}]}'epg_channel_id: null removes a mapping. Preview what an EPG channel will show with GET /epg/channels/{id}/programmes.
3. Settings
The epg settings group has these keys:
| Key | Default | What it does |
|---|---|---|
enabled | true | Scheduled refreshes. When off, sources refresh only when you click Refresh now. |
days_ahead | 7 | Days of future programmes kept at each refresh. |
days_back | 1 | Days of past programmes kept at each refresh. The source's Days to keep counts too, the larger one wins. |
auto_map_new_streams | true | Stored, but not used yet. |
bash
curl -s -X PATCH $PANEL/settings/epg \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"days_ahead": 3}'What apps get
After each refresh or mapping change, Bitstream rebuilds one gzip XMLTV file per bouquet set. A client only gets the channels in its own bouquets, with the names it sees in its playlist. Apps also read now and next through player_api.php. See the client API.
Big guides
Bitstream reads the file as a stream, so a large guide does not need a lot of memory. To stop abuse it caps a file at 4 GiB unpacked and 50,000 channels.