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:
- Generic JSON: an object or array of channels (optionally in groups). Several field-name variants are accepted, so many home-made JSON files read as they are.
- The iptv-org
streams.jsonshape: an array of streams, each withchannel,title,urland headers. The iptv-org project uses this shape for its public data.
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:
- an object
{ "name", "epgUrl", "channels": [ … ], "groups": [ … ] }(channelandgroupare accepted too); - an object with only
channels, or onlygroups; - an array of channel objects:
[ { … }, { … } ]; - an array of group objects.
| Playlist field | Required | Meaning |
|---|---|---|
name | no | Playlist name. |
epgUrl | no | XMLTV guide URL. |
channels (or channel) | no | Array of channels that are in no group, or that name their own group. |
groups (or group) | no | Array of groups: { "id"?, "name", "channels": [ … ] }. |
| Channel field | Required | Also accepted | Meaning |
|---|---|---|---|
id | yes | Unique id, a string. | |
name | yes | Display name. | |
url | yes (or remote_data.url) | remote_data: { "url": "…" } | Stream URL. |
logoUrl | no | logo, image: { "url": "…" } | Logo. |
groupTitle | no | group | Group name (when the channel is not inside a groups entry). |
groupId | no | Group id; derived from the name if missing. | |
epgId | no | epg | The channel's id in the XMLTV guide (like M3U tvg-id). |
description | no | Description. | |
attributes | no | A 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:
| Field | Type | Meaning |
|---|---|---|
channel | string or null | Channel id, for example ExampleNews.us. |
feed | string or null | Feed id, for example HD. The full stream id is channel@feed, for example ExampleNews.us@HD. |
title | string | Stream title. |
url | string | Stream URL. |
referrer | string or null | Referer header. |
user_agent | string or null | User-Agent header. |
quality | string or null | Maximum quality, for example 720p. |
labels | array | Labels 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/"
}
}
]
}
]
}
nameandepgUrl: the playlist name and the example guide.channels: two channels that name their own group withgroup(“Test” and “Radio”).groups: a “News” group with one channel that has a logo, anepgIdand two headers inattributes.
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
- Open a plain-text editor. VS Code is best because it flags JSON syntax errors as you type.
- Copy one of the examples above and edit the channels.
- Use straight double quotes
"for every key and string;idis always a string ("7", not7). - No comma after the last element, and no
//comments. - 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
- Open Add IPTV Source (the Add IPTV button).
- Enter a Source Name, paste the link into Source Link and choose Add IPTV; or choose Import from file and pick the
.jsonfile. - 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
| Mistake | Symptom | Fix |
|---|---|---|
A comma after the last element ([{…},]) | The file cannot be read | Remove the extra comma. |
// or /* */ comments | The file cannot be read | JSON has no comments; remove them. |
A numeric id ("id": 7) | TS IPTV still reads it, but other apps may reject it | Write it as a string: "id": "7". |
Curly quotes “ ” | The file cannot be read | Retype them as straight ". |
A channel without name or url | The file cannot be read, or the channel does not play | Every 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 field | Read as generic JSON, which requires id, so the whole file cannot be read | Keep the iptv-org shape exactly, or switch fully to generic JSON. |
What TS IPTV supports
| Feature | Status |
|---|---|
| All four generic top-level shapes, including arrays | Supported on every platform |
Nested groups, remote_data.url, image.url | Supported |
Headers from attributes (generic) and referrer/user_agent (iptv-org) | Android iOS: best effort Desktop: User-Agent and Referer only |
epgUrl | Supported |
iptv-org labels, quality | Accepted, not shown yet |
| DRM, catch-up | Not in JSON Use M3U. |