Match M3U tvg-id to XMLTV
For dependable EPG matching, set an M3U entry's
tvg-id to the exact value of the corresponding XMLTV
<channel id="…">. The programme records must
reference that same ID in their
channel attribute.
Exact relationship
M3U: #EXTINF:-1 tvg-id="example.channel",Example channel XMLTV: <channel id="example.channel">…</channel> <programme channel="example.channel" start="…" stop="…">…</programme>
Safe matching workflow
- Parse all XMLTV channel IDs and display names.
- Keep exact existing
tvg-idmatches. - Review unmatched playlist entries manually using provider, region, language and channel identity—not name similarity alone.
- Reject ambiguous matches such as national variants, time-shift channels, HD/SD editions or channels sharing a generic name.
- Recheck programme coverage after saving the mapping.
Why an EPG can still be empty
- The ID differs by case or punctuation.
- The XMLTV file declares the channel but contains no current programme rows.
- Programme times include the wrong UTC offset.
- The playlist and guide describe different regional or time-shift services.
- The guide is stale or truncated.
Never invent a schedule from a similar channel name. An honest missing match is safer than displaying the wrong programme.
Source
See the XMLTV project's current XMLTV DTD for the formal channel and programme relationship.