TS IPTV

XSPF playlists

XSPF (XML Shareable Playlist Format, pronounced “spiff”) is an XML playlist format. VLC uses it to save playlists, including IPTV channel lists.

TS IPTV includes no channels. It plays only the playlists you add.

What XSPF is

XSPF is an open format defined by the XSPF version 1 specification. Each entry is a <track> with a location, a title and an image. It is more verbose than M3U but strictly structured; you usually meet it when you save a list from VLC.

Syntax

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
  <title>…</title>                 (0 or 1)
  <trackList>                     (exactly 1, may be empty)
    <track>
      <location>URI</location>    (0 or more; only one is played)
      <title>…</title>             (0 or 1)
      <image>URI</image>          (0 or 1)
      <extension application="URI">…</extension>
    </track>
  </trackList>
</playlist>

VLC's extension

VLC adds its own information inside <extension application="http://www.videolan.org/vlc/playlist/0">, with the namespace xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/":

ElementWhereMeaning
<vlc:id>in each track's <extension>The track's number. TS IPTV uses it as the channel id.
<vlc:node title="…">in the playlist-level <extension>A group (folder).
<vlc:item tid="N"/>inside <vlc:node>The track whose vlc:id is N belongs to this group.
<vlc:option>in a track's <extension>A VLC playback option. TS IPTV ignores it.

Complete example

The first track is the Mux public test stream (Big Buck Bunny © Blender Foundation, CC BY 3.0); the second uses an example.com placeholder.

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">
  <title>TS IPTV example playlist</title>
  <trackList>
    <track>
      <location>https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8</location>
      <title>HLS Test Channel</title>
      <extension application="http://www.videolan.org/vlc/playlist/0">
        <vlc:id>0</vlc:id>
      </extension>
    </track>
    <track>
      <location>https://cdn.example.com/news/index.m3u8</location>
      <title>Example News</title>
      <image>https://example.com/logos/news.png</image>
      <extension application="http://www.videolan.org/vlc/playlist/0">
        <vlc:id>1</vlc:id>
      </extension>
    </track>
  </trackList>
  <extension application="http://www.videolan.org/vlc/playlist/0">
    <vlc:node title="Test"><vlc:item tid="0"/></vlc:node>
    <vlc:node title="News"><vlc:item tid="1"/></vlc:node>
  </extension>
</playlist>
  1. Line 2 declares both the XSPF namespace and the VLC namespace.
  2. The first <title> is the playlist name.
  3. Each <track> has a <location> (the stream URL), a <title> (the channel name), optionally an <image> (the logo), and a <vlc:id>.
  4. The <extension> at the end puts the tracks in the groups “Test” and “News”.

Keep one element per line. TS IPTV's current XSPF reader works line by line, so <location>…</location>, <title>…</title> and <vlc:id>…</vlc:id> must each fit on one line, as in the example. VLC saves files this way too.

Create one

With VLC

  1. Open the streams in VLC (Media › Open Network Stream) so they are in its playlist.
  2. Choose Media › Save Playlist to File….
  3. Pick the XSPF format and save with the extension .xspf.

By hand

  1. Copy the example above into a plain-text editor.
  2. Add or edit <track> elements, one element per line.
  3. Write & in URLs as &amp;.
  4. Save as UTF-8 with the extension .xspf.

Host it

Just like M3U: any HTTPS link that returns the file itself works (https://raw.githubusercontent.com/<user>/<repo>/<branch>/playlist.xspf, https://<user>.github.io/<repo>/playlist.xspf, https://www.example.com/playlist.xspf, Dropbox with dl=1). Share pages and GitHub blob/ links do not work. HTTPS is recommended; TS IPTV needs no CORS. The server may send Content-Type: application/xspf+xml or text/xml. Details: hosting an M3U file.

Add it in TS IPTV

  1. Open Add IPTV Source (the Add IPTV button).
  2. Enter a Source Name, paste the link into Source Link and choose Add IPTV; or choose Import from file and pick the .xspf file.
  3. TS IPTV recognises XSPF by the <?xml …?> first line and the namespace and shows how many channels it found. On a TV, use a link if the TV has no file picker.

Common mistakes

MistakeSymptomFix
Missing <?xml version="1.0" encoding="UTF-8"?> first lineNot recognised as a playlistPut it at the very start of the file; TS IPTV currently needs it to detect XSPF.
Missing or wrong xmlnsNot recognised as a playlistUse exactly xmlns="http://xspf.org/ns/0/".
& in a URL not written as &amp;XML errorWrite &amp;.
The URL placed in <title> or <info>The track does not playPut the stream URL in <location>.
An element broken across several linesMissing name or linkKeep each element on one line.
A track without <title>The track is skippedEach track needs both <location> and <title>.
Relying on <duration> for a live channelNo effectLeave <duration> out for live streams.

What TS IPTV supports

FeatureStatus
Track location, title, imageSupported on every platform
vlc:id as the channel idSupported
Groups from vlc:nodePartial Group names are read, but tracks are not yet assigned to groups by vlc:item tid.
Elements written across several linesNot supported Keep each element on one line.
Headers, DRM, programme guideNot in XSPF Use M3U if you need them.