This section describes other functions which can be accessed via HTTP. They are not part of the HTTP API and so are not preceded by 'api'.
Unless otherwise stated no special privilege is needed to use these functions.
comet/poll
Returns a JSON object containing data used by the Tvheadend UI, including the disk space utilisation.
The "freediskspace" and "totaldiskspace" figures relate to the disk partition holding the recorder Storage Path, "useddiskspace" is the total size of all files stored below that point. These figures may not give the actual storage situation if there are multiple storage devices and mount points.
Downloads an icon file. The filename is hard-coded in the source; on installation it is usually placed at /usr/share/tvheadend/src/webui/static/img/logo.png.
imagecache
Outputs an image from the image cache. Requires streaming, recording or web interface privilege.
The function examines the 'User-Agent' string sent by the client. If the user-agent is on a preset list (or is not present), data transfer starts immediately; if not then a playlist is returned to the client.
The User-Agent list is "MPlayer", "curl/", "wget/", "TVHeadend", "Lavf" and any string containing "shoutcastsource".
the url in the returned playlist will contain an authentication ticket, removing any need to enter credentials in order to access the data. However the ticket is only valid for five minutes so the playlist cannot be re-used after that time.
When playing streams, the parameters for the underlying stream function can also be used.
playlist
This is a complex function which outputs lists of content available from the server, in various formats and filtered in several ways. The syntax for invoking the function depends on the required output and not all combinations of inputs are valid.
The value of <x> in the URL specifies the format of the output. The options are e2, m3u or satip, with m3u the default if the item is omitted. For recordings only m3u is available.
For channels, a parameter sort can be added. This can take the value 'name' or 'numname', to sort the output by channel name or channel number respectively.
See below for notes including the values of <y> in the URL, and sample outputs.
The value of <x> in the URL specifies the format of the output. The options are e2, m3u or satip, with m3u the default if the item is omitted. For recordings only m3u is available.
See below for notes including the values of <y> in the URL, and sample outputs.
Notes
The list of recordings includes all entries in the DVR logs, including failed and missed recordings and recordings to be made in the future (ie timers). Unplayable recordings have 'bandwidth=0' in the output.
The value of <y> in the URLs, if supplied, specifies whether the channel list or playlist should include authentication in the URL. If <y> is ticket, each entry includes an access-control 'ticket' - these tickets are only valid for five minutes, they are different for each channel/recording listed, and calling the playlist again will output a different set of tickets.
Alternatively, if Persistent Authentication is in use (TVHeadend versions > 4.3.1485), the value of <y> may be set to auth. The auth code must be appended to the URL as a parameter, eg.
A rudimentary user interface to TVHeadend. It shows the contents of the recorder log (both completed and future recordings) and allows entries to be cancelled or deleted. A search box allows the EPG to be scanned for matching entries; clicking on an entry opens an information page which contains a button allowing the event to be recorded. Requires RECORDER privilege.
special/srvid2
Outputs details of encrypted services. Each item contains:
Outputs the TVHeadend version number and a (text) list of channels. This function requires Admin privilege.
The binary hash is only filled-in if the server runs on an x86 processor.
$ curl 'http://user:pass@192.168.0.1:9981/state'
Tvheadend 4.3-1215~g5782d8c14-dirty Binary SHA1: 0000000000000000000000000000000000000000
Channels
----------------------------------------------
tru TV (13183175)
refcount = 0
number = 156
icon = <none set>
ITV3 (54665543)
refcount = 0
number = 114
icon = <none set>
...
status.xml
Outputs the current status of the server, including CPU load average, recordings in progress (or minutes to the next recording) and the number of active subscriptions. Needs 'Web interface' or 'Recorder' privilege.
The final variation lists the complete EPG together with a channel list. Example:
$ curl http://192.168.0.1:9981/xmltv/channels
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
<tv generator-info-name="TVHeadend-4.3-1670~ge37c696de-dirty" source-info-name="tvh-Tvheadend">
<channel id="7e7b77801531c803f5ce8f4d5003f44c">
<display-name>Channel 5+1</display-name>
</channel>
...
<programme start="20181231151500 +0000" stop="20181231161500 +0000" channel="7e7b77801531c803f5ce8f4d5003f44c">
<title lang="eng">Dirty Dancing</title>
<desc lang="eng">Classic starring Patrick Swayze and Jennifer Grey. A spoiled 17-year-old learns a lot about life from the hotel dance instructor during a family summer holiday. (1987)[S]</desc>
<category lang="en">Movie / Drama</category>
</programme>
...
</tv>
If Persistent Authentication is in use (TVHeadend versions > 4.3.1485), the auth code must be appended to the URL as a parameter.