TS IPTV

JSON playlists

TS IPTV reads two JSON channel-list shapes: generic JSON (TS IPTV's own, flexible shape) and the iptv-org streams.json shape. This page describes both.

TS IPTV includes no channels. It plays only the playlists you add. This page describes formats only and recommends no list.

Two JSON shapes

There is no common standard for JSON channel lists; every app uses its own shape. TS IPTV reads two:

TS IPTV detects the shape: if the file starts with [ and the first element has channel, url and title but no name, it is the iptv-org shape; any other file that starts with { or [ is generic JSON.

Syntax

Generic JSON

Accepted top-level shapes:

  1. an object { "name", "epgUrl", "channels": [ … ], "groups": [ … ] } (channel and group are accepted too);
  2. an object with only channels, or only groups;
  3. an array of channel objects: [ { … }, { … } ];
  4. an array of group objects.
Playlist fieldRequiredMeaning
namenoPlaylist name.
epgUrlnoXMLTV guide URL.
channels (or channel)noArray of channels that are in no group, or that name their own group.
groups (or group)noArray of groups: { "id"?, "name", "channels": [ … ] }.
Channel fieldRequiredAlso acceptedMeaning
idyesUnique id, a string.
nameyesDisplay name.
urlyes (or remote_data.url)remote_data: { "url": "…" }Stream URL.
logoUrlnologo, image: { "url": "…" }Logo.
groupTitlenogroupGroup name (when the channel is not inside a groups entry).
groupIdnoGroup id; derived from the name if missing.
epgIdnoepgThe channel's id in the XMLTV guide (like M3U tvg-id).
descriptionnoDescription.
attributesnoA string map with the same keys as M3U attributes. "user-agent" and "referrer" become HTTP headers.

Fields that are not in the table are ignored.

The iptv-org streams.json shape

An array; each element is one stream:

FieldTypeMeaning
channelstring or nullChannel id, for example ExampleNews.us.
feedstring or nullFeed id, for example HD. The full stream id is channel@feed, for example ExampleNews.us@HD.
titlestringStream title.
urlstringStream URL.
referrerstring or nullReferer header.
user_agentstring or nullUser-Agent header.
qualitystring or nullMaximum quality, for example 720p.
labelsarrayLabels such as Geo-blocked, Not 24/7.

Complete examples

Generic JSON

The first channel is the Mux public test stream (Big Buck Bunny © Blender Foundation, CC BY 3.0); the others use example.com placeholders.

{
  "name": "TS IPTV example playlist",
  "epgUrl": "https://tsiptv.web.app/examples/guide.xml",
  "channels": [
    {
      "id": "HlsTest.example",
      "name": "HLS Test Channel",
      "url": "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
      "group": "Test",
      "epgId": "HlsTest.example"
    },
    {
      "id": "ExampleRadio.us",
      "name": "Example Radio",
      "url": "https://cdn.example.com/radio/stream.aac",
      "group": "Radio"
    }
  ],
  "groups": [
    {
      "name": "News",
      "channels": [
        {
          "id": "ExampleNews.us",
          "name": "Example News",
          "url": "https://cdn.example.com/news/index.m3u8",
          "logo": "https://example.com/logos/news.png",
          "epgId": "ExampleNews.us",
          "attributes": {
            "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
            "referrer": "https://example.com/"
          }
        }
      ]
    }
  ]
}
  1. name and epgUrl: the playlist name and the example guide.
  2. channels: two channels that name their own group with group (“Test” and “Radio”).
  3. groups: a “News” group with one channel that has a logo, an epgId and two headers in attributes.

The shortest form is an array: [{"id":"a","name":"A","url":"https://cdn.example.com/a.m3u8"}].

iptv-org shape

[
  {
    "channel": "HlsTest.example",
    "feed": null,
    "title": "HLS Test Channel",
    "url": "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
    "referrer": null,
    "user_agent": null,
    "quality": null,
    "labels": []
  },
  {
    "channel": "ExampleNews.us",
    "feed": "HD",
    "title": "Example News HD",
    "url": "https://cdn.example.com/news/index.m3u8",
    "referrer": "https://example.com/",
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
    "quality": "1080p",
    "labels": ["Not 24/7"]
  }
]

The first element is the Mux test stream, with no headers. The second is a placeholder with a feed, a referrer and a user_agent; its stream id is ExampleNews.us@HD.

Create one by hand

  1. Open a plain-text editor. VS Code is best because it flags JSON syntax errors as you type.
  2. Copy one of the examples above and edit the channels.
  3. Use straight double quotes " for every key and string; id is always a string ("7", not 7).
  4. No comma after the last element, and no // comments.
  5. Save as UTF-8 (no BOM) with the extension .json.

Need per-channel headers, DRM or catch-up information? Use M3U or TS IPTV Source. Need movies, series with seasons and episodes, several streams per item, or your own home layout and colours? Use TS IPTV Source, which is also JSON.

Host it

Just like M3U: any HTTPS link that returns the file itself works (https://raw.githubusercontent.com/<user>/<repo>/<branch>/playlist.json, https://<user>.github.io/<repo>/playlist.json, https://www.example.com/playlist.json, Dropbox with dl=1). GitHub's file view (github.com/…/blob/…) is a web page, not the file. The server should send Content-Type: application/json, but TS IPTV detects the content anyway. HTTPS is recommended; TS IPTV needs no CORS. 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 .json file.
  3. TS IPTV detects the JSON shape and shows how many channels it found. If the file has an epgUrl, the guide is downloaded with it.

Common mistakes

MistakeSymptomFix
A comma after the last element ([{…},])The file cannot be readRemove the extra comma.
// or /* */ commentsThe file cannot be readJSON has no comments; remove them.
A numeric id ("id": 7)TS IPTV still reads it, but other apps may reject itWrite it as a string: "id": "7".
Curly quotes “ ”The file cannot be readRetype them as straight ".
A channel without name or urlThe file cannot be read, or the channel does not playEvery channel needs id, name and url.
The link is a GitHub page instead of the raw file“This link opens a web page”Use the Raw link.
An iptv-org file with an extra name fieldRead as generic JSON, which requires id, so the whole file cannot be readKeep the iptv-org shape exactly, or switch fully to generic JSON.

What TS IPTV supports

FeatureStatus
All four generic top-level shapes, including arraysSupported on every platform
Nested groups, remote_data.url, image.urlSupported
Headers from attributes (generic) and referrer/user_agent (iptv-org)Android iOS: best effort Desktop: User-Agent and Referer only
epgUrlSupported
iptv-org labels, qualityAccepted, not shown yet
DRM, catch-upNot in JSON Use M3U.