EPG for OTT middleware

The programme schedule held in the EPG database is delivered to external systems — set-top boxes, applications and OTT middleware — in two ways: as a complete XMLTV document served by the dedicated EPG server, and as a single-day channel schedule in JSON served by the node HTTP API.

XMLTV delivery

XMLTV is distributed by a separate built-in EPG server. It is enabled on the “EPG server” screen (EPG server): “Enable EPG server”, the HTTP port (43973 by default), optionally HTTPS with a certificate (port 43983 by default) and the “Host name”.

Access is granted per account (the “Accounts” tab of the “EPG Settings” screen, EPG Settings): login and password, “Channel set”, “Expiry date”, “Allowed IP” and the “Paused” flag. The contents of the delivery are determined by the channel set:

  • sets are created on the “Channel sets” tab;

  • channels are added to sets in the EPG database (EPG Database); a channel may belong to several sets;

  • one set is assigned to an account — without it the delivery is empty.

The document is available at /xmltv (and /xmltv.gz — the compressed file); authorization is HTTP Digest or via request parameters. Programme times are emitted with the channel time zone; only current and future events are included in the document. If the same channel identifier arrived from different sources, the channel is emitted once and the skip is reported in the log.

Single-day schedule in JSON

For middleware interfaces the node returns the schedule of a channel for one day in JSON with a single HTTP API request (authorization is the same as for the other API requests):

GET /data/epg/channel?src=<source>&ch=<channel>&lang=<language>&t=<time>

The response is the list of events of the day (in UTC) that contains the time t: start, end, title and description of each programme in the requested language; if no translation exists, the default language is used, then any available one. An empty day is a valid empty list. Responses are cached by the server and refreshed automatically when new EPG data arrives.

The built-in cache is designed for approximately one thousand concurrent clients; for larger installations both the XMLTV and the JSON delivery should be fronted by a caching reverse proxy or a CDN.

Playback of the DVR archive by a programme-schedule event (the epg parameter in the playback URL) is described in Archive playback (VOD).