TS IPTV

Stremio-compatible addons

An addon is a small web service, or even a folder of static JSON files, that answers a handful of HTTP requests with catalogues, details and stream links. The addon protocol is open and documented; TS IPTV can use any addon that follows it and returns ordinary video links.

TS IPTV includes no channels and no addons. Nothing is pre-installed and TS IPTV does not recommend any addon. Addons are third-party services that you add yourself; you are responsible for having the rights to what you watch through them.

The protocol was created for the Stremio app and is published as the open stremio-addon-sdk specification. TS IPTV is not affiliated with or endorsed by Stremio; “Stremio-compatible” only describes the protocol. Every example uses TS IPTV's own sample addon on tsiptv.web.app, public-domain films from archive.org, a public test stream or example.com placeholders.

What an addon is

An addon is identified by the link to its manifest, a JSON file that always ends in /manifest.json. The manifest says what the addon offers: which content types (movie, series, tv…), which catalogues, and which resources (catalogue lists, details, streams, subtitles). The player then builds further URLs from the manifest's address and requests them with plain HTTP GET. Every answer is JSON. There is no login, no session and no custom transport, which is why an addon can be as simple as a set of files on a static web host.

Addons are useful for publishing your own collection with posters, descriptions, seasons and episodes, for example a home media server, a licensed service you operate, or an archive of public-domain films.

The protocol

The normative text is the SDK's protocol.md and the API reference. This section summarises what an addon author needs.

URLs

The base URL is the manifest link without /manifest.json. All other requests are built from it:

GET {base}/manifest.json
GET {base}/{resource}/{type}/{id}.json
GET {base}/{resource}/{type}/{id}/{extra}.json
ResourcetypeidResponse
catalogthe catalogue's typethe catalogue id from the manifest{ "metas": [ … ] }
metathe item's typethe item id from the catalogue{ "meta": { … } }
streamthe item's typethe video id (a film: its own id; an episode: the episode id; tv: the channel id){ "streams": [ … ] }
subtitlesthe item's typethe video id{ "subtitles": [ … ] }
addon_catalogfrom addonCatalogsfrom addonCatalogs{ "addons": [ … ] }

Encoding: path segments and extra

Manifest

FieldRequiredMeaning
idyesReverse-DNS identifier, for example com.example.myaddon. The same id added again means an update.
versionyesVersion string, normally semver (1.0.0).
nameyesDisplay name.
descriptionyes (spec)One or two sentences.
typesyesContent types: movie, series, channel, tv, or any other string.
resourcesyes"catalog", "meta", "stream", "subtitles", "addon_catalog", or objects { "name": "stream", "types": ["movie"], "idPrefixes": ["ex_"] }.
catalogsyes (may be [])List of catalogues (below).
idPrefixesnoOnly ids starting with one of these are sent to the addon, for example ["ex_"].
addonCatalogsnoLists of other addons (type, id, name).
behaviorHintsnoadult, p2p, configurable, configurationRequired, epgProvider, all booleans.
logo, background, contactEmailnoLogo (256×256 PNG), background image, contact address.

A catalogue is { "type", "id", "name", "extra": [ … ] }. The same id may be used for several types. Each extra entry is { "name", "isRequired", "options", "optionsLimit" }:

ExtraMeaning
searchFree-text search. isRequired: true makes a search-only catalogue that is never shown as a row.
genreFilter; the values come from options. A required genre starts on its first option.
skipPaging (below).
other namesAllowed; declare them the same way.

Older manifests use extraSupported/extraRequired string lists and a separate genres list; TS IPTV reads those too, but extra wins when both are present.

Paging

A catalogue page holds up to 100 items. The first page is requested without skip; the following pages with skip=100, skip=200 and so on. The specification says a page with fewer than 100 items is the end. TS IPTV is more lenient: it asks for the next page with skip equal to the number of items received so far and stops at an empty page, a page with no new ids, or an error answer after a short page (a static host's 404). Only declare skip if your catalogue has more than one page.

Catalogue items and details

FieldWhereMeaning
id, type, namebothRequired.
poster, posterShapebothImage; shape poster (portrait, default), square or landscape.
genres, releaseInfo, description, imdbRatingbothText shown on cards and on the detail page.
background, logo, released, runtime, language, country, linksmetaDetail page fields. released is ISO 8601; runtime is text such as "92 min".
videosmetaEpisodes of a series (or a channel's videos). Without videos, the item has one video whose id is the item id.
behaviorHints.defaultVideoId, behaviorHints.isLivemetaOpen this video directly; a live item (tv implies live).

A video is { "id", "title", "released", "season", "episode", "thumbnail", "overview" }. Season 0 means specials. A released date in the future marks an upcoming episode. If a video carries its own streams array, those are the only streams used for it.

Streams

Each stream object has exactly one source and some labels:

FieldMeaning
urlA direct https (or http) link: MP4, MKV, HLS .m3u8, DASH .mpd.
externalUrlA web page to open in a browser.
nameShort label, for example the quality.
description (older: title)Longer label, may have several lines.
behaviorHints.proxyHeaders.requestHTTP headers to send with every request for this stream, for example { "User-Agent": "…", "Referer": "…" }. The specification requires notWebReady: true alongside.
behaviorHints.notWebReadyThe link cannot play directly in a web browser (not MP4, plain http, or needs headers).
behaviorHints.bingeGroupStreams of the same group are preferred for the next episode.
behaviorHints.filename, videoSizeFile name and size; helps players guess the format.
behaviorHints.countryWhitelistISO 3166-1 alpha-3 codes (lower case) where the stream works.

Other source fields exist in the specification; TS IPTV does not use them (see What TS IPTV plays). Order streams from highest to lowest quality.

Subtitles

GET {base}/subtitles/{type}/{videoId}.json, optionally with videoHash, videoSize and filename in extra, returns { "subtitles": [ { "id", "url", "lang", "label" } ] }. lang is an ISO 639-2 code such as eng; files are SRT or VTT. TS IPTV does not use subtitle addons yet.

Caching

Any response may carry cacheMaxAge, staleRevalidate and staleError (seconds). The SDK turns them into a Cache-Control header and also keeps them in the JSON. TS IPTV honours Cache-Control first, then these fields, then its own defaults (catalogues 1 hour, details 6 hours, streams 5 minutes), and never keeps stream answers longer than 5 minutes.

Types and ids

Types are free strings; movie, series, channel and tv are the common ones. Ids are opaque. Give your ids a prefix of your own (ex_news, tspd_his_girl_friday) and declare it in idPrefixes, so the player only asks your addon about your items. Episode ids are separate ids, for example tspd_superman_s1e1.

Complete example: the sample addon

TS IPTV publishes a small static addon, the Public Domain Sampler, as a live example and QA fixture. It has one film (His Girl Friday, 1940), one cartoon series (Fleischer Superman, 1941–43), both public domain on archive.org, and one live channel that plays the Mux public test stream (Big Buck Bunny © Blender Foundation, CC BY 3.0). Its manifest link is https://tsiptv.web.app/examples/stremio-sampler/manifest.json.

These are all its files; each one is exactly the URL a player requests:

manifest.json
catalog/movie/tspd-movie.json
catalog/movie/tspd-movie/genre=Comedy.json
catalog/series/tspd-series.json
catalog/tv/tspd-tv.json
meta/movie/tspd_his_girl_friday.json
meta/series/tspd_superman.json
meta/tv/tspd_test_hls.json
stream/movie/tspd_his_girl_friday.json
stream/series/tspd_superman_s1e1.json
stream/tv/tspd_test_hls.json

manifest.json

{
  "id": "org.tsiptv.publicdomain.static",
  "version": "1.0.0",
  "name": "Public Domain Sampler (static)",
  "description": "Public-domain films and cartoons from archive.org, plus a public HLS test channel. Static JSON on GitHub Pages.",
  "resources": ["catalog", "meta", "stream"],
  "types": ["movie", "series", "tv"],
  "idPrefixes": ["tspd_"],
  "catalogs": [
    { "type": "movie",  "id": "tspd-movie",  "name": "Public Domain Movies",
      "extra": [ { "name": "genre", "isRequired": false, "options": ["Comedy"] } ] },
    { "type": "series", "id": "tspd-series", "name": "Public Domain Cartoons" },
    { "type": "tv",     "id": "tspd-tv",     "name": "Test Channels" }
  ],
  "behaviorHints": { "adult": false, "p2p": false }
}

Three catalogues, one per type. The movie catalogue declares a genre extra with a single option, so exactly one extra file exists: catalog/movie/tspd-movie/genre=Comedy.json (a copy of the unfiltered list). idPrefixes is tspd_, and ids use _, never :, because every id becomes a file name.

catalog/movie/tspd-movie.json

{
  "metas": [
    { "id": "tspd_his_girl_friday", "type": "movie", "name": "His Girl Friday",
      "poster": "https://archive.org/services/img/his_girl_friday",
      "releaseInfo": "1940", "genres": ["Comedy"] }
  ]
}

Requested as …/catalog/movie/tspd-movie.json. The catalogue does not declare skip, so this single page is the whole catalogue and no further page is requested.

meta/series/tspd_superman.json

{
  "meta": {
    "id": "tspd_superman", "type": "series", "name": "Fleischer Superman (1941-43)",
    "poster": "https://archive.org/services/img/superman_the_mechanical_monsters",
    "releaseInfo": "1941-1943", "genres": ["Animation"],
    "description": "Fleischer Studios Superman cartoons, public domain.",
    "videos": [
      { "id": "tspd_superman_s1e1", "title": "The Mechanical Monsters",
        "season": 1, "episode": 1, "released": "1941-11-28T00:00:00.000Z",
        "thumbnail": "https://archive.org/services/img/superman_the_mechanical_monsters" }
    ]
  }
}

A series lists its episodes in videos. The episode id tspd_superman_s1e1 is what the stream request uses.

stream/movie/tspd_his_girl_friday.json and stream/tv/tspd_test_hls.json

{
  "streams": [
    { "name": "archive.org", "description": "MP4 · 512kb",
      "url": "https://archive.org/download/his_girl_friday/his_girl_friday_512kb.mp4",
      "behaviorHints": { "filename": "his_girl_friday_512kb.mp4" } }
  ]
}
{
  "streams": [
    { "name": "HLS", "description": "Mux public test stream",
      "url": "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
      "behaviorHints": { "notWebReady": true,
                         "proxyHeaders": { "request": { "User-Agent": "TSIPTV-Example/1.0" } } } }
  ]
}

The film's stream is a direct MP4 url with a filename hint. The live channel's stream is HLS and asks for a User-Agent header through proxyHeaders.request; TS IPTV sends it with every playlist and segment request. The remaining files follow the same pattern: series catalogue, tv catalogue, film details, channel details, episode stream, Comedy genre file.

Create your own addon

Option 1: static JSON files (no server)

  1. Download the sample files above into a folder with the same tree.
  2. Edit manifest.json: a new id (reverse-DNS of a domain you control), name, description, your own idPrefixes and catalogues.
  3. For each catalogue, write catalog/{type}/{catalogId}.json. Add one file per genre option (catalog/{type}/{catalogId}/genre={option}.json) and, for more than 100 items, …/skip=100.json, …/skip=200.json.
  4. For each item, write meta/{type}/{id}.json; for each film, episode or channel, stream/{type}/{videoId}.json.
  5. Keep ids and extra values URL-safe: letters, digits, _ and -. Validate each file as JSON (VS Code shows errors as you type).
  6. Test locally: in the folder run npx http-server . --cors -c-1 and add http://127.0.0.1:8080/manifest.json (Android emulator: http://10.0.2.2:8080/manifest.json).

Limits of static hosting: no free-text search (queries cannot be pre-generated), one file per genre and page, and no : in ids (the host would look for a file name with :, which Windows and some hosts do not allow).

Option 2: the Node.js SDK

With the official SDK (Node.js 12 or later) you write handlers instead of files, which allows search, large catalogues and computed answers. serveHTTP adds the CORS headers for you and turns the cacheMaxAge, staleRevalidate and staleError values your handlers return into a Cache-Control header.

package.json:

{
  "name": "my-publicdomain-addon",
  "version": "1.0.0",
  "main": "addon.js",
  "scripts": { "start": "node addon.js" },
  "dependencies": { "stremio-addon-sdk": "^1.6.10" }
}

addon.js (the sample addon with search, genre filter and paging):

const { addonBuilder, serveHTTP } = require('stremio-addon-sdk')

const ITEMS = [
  { id: 'tspd_his_girl_friday', type: 'movie', name: 'His Girl Friday',
    releaseInfo: '1940', genres: ['Comedy'],
    poster: 'https://archive.org/services/img/his_girl_friday',
    streams: [{ name: 'archive.org', description: 'MP4 512kb',
      url: 'https://archive.org/download/his_girl_friday/his_girl_friday_512kb.mp4',
      behaviorHints: { filename: 'his_girl_friday_512kb.mp4' } }] },
  { id: 'tspd_superman', type: 'series', name: 'Fleischer Superman (1941-43)',
    releaseInfo: '1941-1943', genres: ['Animation'],
    poster: 'https://archive.org/services/img/superman_the_mechanical_monsters',
    videos: [{ id: 'tspd_superman_s1e1', title: 'The Mechanical Monsters',
      season: 1, episode: 1, released: '1941-11-28T00:00:00.000Z',
      streams: [{ name: 'archive.org', description: 'MP4 512kb',
        url: 'https://archive.org/download/superman_the_mechanical_monsters/superman_the_mechanical_monsters_512kb.mp4' }] }] },
  { id: 'tspd_test_hls', type: 'tv', name: 'HLS Test Channel',
    posterShape: 'square', poster: 'https://archive.org/services/img/his_girl_friday',
    streams: [{ name: 'HLS', description: 'Mux public test stream',
      url: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
      behaviorHints: { notWebReady: true,
        proxyHeaders: { request: { 'User-Agent': 'TSIPTV-Example/1.0' } } } }] }
]
const PAGE = 100

const builder = new addonBuilder({
  id: 'org.example.publicdomain', version: '1.0.0', name: 'My Public Domain Addon',
  description: 'Public-domain films and cartoons, plus a public HLS test channel.',
  resources: ['catalog', 'meta', 'stream'], types: ['movie', 'series', 'tv'],
  idPrefixes: ['tspd_'],
  catalogs: ['movie', 'series', 'tv'].map(type => ({
    type, id: 'tspd-' + type, name: 'Public Domain ' + type,
    extra: [{ name: 'search' }, { name: 'genre', options: ['Animation', 'Comedy'] }, { name: 'skip' }]
  })),
  behaviorHints: { adult: false, p2p: false }
})

const preview = i => ({ id: i.id, type: i.type, name: i.name, poster: i.poster,
  posterShape: i.posterShape, genres: i.genres, releaseInfo: i.releaseInfo })

builder.defineCatalogHandler(({ type, id, extra }) => {
  let list = ITEMS.filter(i => i.type === type && id === 'tspd-' + type)
  if (extra.genre) list = list.filter(i => (i.genres || []).includes(extra.genre))
  if (extra.search) list = list.filter(i => i.name.toLowerCase().includes(extra.search.toLowerCase()))
  const skip = parseInt(extra.skip || '0', 10) || 0
  return Promise.resolve({ metas: list.slice(skip, skip + PAGE).map(preview), cacheMaxAge: 3600 })
})

builder.defineMetaHandler(({ type, id }) => {
  const i = ITEMS.find(x => x.id === id && x.type === type)
  if (!i) return Promise.resolve({ meta: null })
  const meta = preview(i)
  if (i.videos) meta.videos = i.videos.map(({ streams, ...v }) => v)
  return Promise.resolve({ meta, cacheMaxAge: 3600 })
})

builder.defineStreamHandler(({ type, id }) => {
  for (const i of ITEMS) {
    if (i.id === id && i.streams) return Promise.resolve({ streams: i.streams, cacheMaxAge: 600 })
    const v = (i.videos || []).find(v => v.id === id)
    if (v) return Promise.resolve({ streams: v.streams, cacheMaxAge: 600 })
  }
  return Promise.resolve({ streams: [] })
})

serveHTTP(builder.getInterface(), { port: process.env.PORT || 7000 })
  1. Run npm install, then npm start. The SDK prints the manifest link, http://127.0.0.1:7000/manifest.json.
  2. Add that link in TS IPTV on the same computer, or http://10.0.2.2:7000/manifest.json from an Android emulator, or http://<your computer's LAN address>:7000/manifest.json from a phone or TV on the same network.
  3. To publish it, deploy to any Node.js host that gives you an HTTPS address, and use https://<your host>/manifest.json.

The SDK can also generate a configuration page (config in the manifest) and mount the addon in an existing Express app; see the SDK README.

Host it

HostWhat to do
GitHub PagesPush the file tree to a repository and enable Pages. Add an empty .nojekyll file at the root so files are served unchanged. Pages already sends Access-Control-Allow-Origin: *. Manifest: https://<user>.github.io/<repo>/manifest.json.
Firebase HostingAdd a header rule in firebase.json: {"source": "**/*.json", "headers": [{"key": "Access-Control-Allow-Origin", "value": "*"}]}. TS IPTV's sample addon is hosted this way.
NetlifyA _headers file at the root with /* and, on the next line, Access-Control-Allow-Origin: *.
Vercelvercel.json: {"headers": [{"source": "/(.*)", "headers": [{"key": "Access-Control-Allow-Origin", "value": "*"}]}]}.
Any web serverServe the folder as static files and add the CORS header, for example in nginx: add_header Access-Control-Allow-Origin *;
Node.js SDKAny Node.js host with HTTPS; serveHTTP sets the CORS headers itself; Cache-Control comes from the cacheMaxAge your handlers return.

A GitHub blob/ page or a file-sharing page is not an addon: the manifest link must return the JSON itself.

Add it in TS IPTV

  1. Phone, tablet, iOS and desktop: Profile → Addons → Add addon. Android TV: Settings → Addons → Add addon (type the link with the on-screen keyboard).
  2. Paste the manifest link (it ends with /manifest.json). A stremio://…/manifest.json install link also works; TS IPTV turns it into https://, or http:// for local and LAN hosts (localhost, 127.0.0.1, 10.x, 192.168.x, 172.16–31.x).
  3. Choose Continue. The preview shows the name, version, host, content types, number of catalogues, whether the addon provides streams, and any warning (not encrypted, peer-to-peer, adult content).
  4. Read and accept the notice (“Addons are third-party services, not operated by TS IPTV…”), then choose Add.
  5. Discover appears: on phones between Home and History, on TV at the top of the Home rail. It shows one row per catalogue; open a title and choose a stream to play it.

If the manifest says configurationRequired, TS IPTV does not add it yet: choose Configure to open the addon's /configure page in your browser (on TV the address is shown as text), finish there, and paste the link it gives you. Manage addons (enable, reorder, update, remove) in the same Addons screen. Addon links can contain personal settings, so TS IPTV stores them encrypted and shows only the host.

Common mistakes

MistakeSymptomFix
The link does not end with /manifest.json“Enter the addon's manifest link. It ends with /manifest.json.”Use the manifest link, not the addon's web page.
A manifest field missing (id, name, version, types, resources)“This link did not return a valid addon manifest.”Add the field; check the file is valid JSON.
+ instead of %20 in a static file nameGenre or search file not foundPlayers send %20; name files with URL-safe values only.
: in ids of a static addonFiles cannot be created on Windows, or 404sUse _ or - in ids.
Pages of 20 itemsOther apps stop after the first pageReturn 100 items per page; only the last page may be shorter.
idPrefixes that do not match your ids, or "stream" missing from resourcesDetails or streams never requestedDeclare every resource you serve and a prefix all your ids share.
A video with its own streamsNo other addon is asked for that videoLeave inline streams out unless they are the only ones.
configurationRequired: true“This addon must be configured first.”Configure it in the browser and paste the configured link.
A link on 127.0.0.1:11470“This address belongs to the Stremio app's own local server…”That server belongs to another app; it is not an addon.
An old /stremio/v1 addon“This is an old-style addon that TS IPTV cannot use.”Only the current HTTP protocol is supported.
An addon that offers only sources other than url“No playable stream was found for this title.”TS IPTV plays url streams only; see below.
No CORS headerWorks in TS IPTV, fails in web playersAdd Access-Control-Allow-Origin: *.
GitHub Pages without .nojekyllFiles starting with _ missingAdd an empty .nojekyll.
Expired or signed stream links cached for longStreams fail after a whileKeep cacheMaxAge short on stream answers.

What TS IPTV plays

FeatureAndroidiOSDesktop
url streams: HTTPS/HTTP MP4, HLSSupportedSupportedSupported
url streams: DASH .mpd without DRMSupportedSupported through the built-in VLC player; only the User-Agent and Referer headers are sentSupported
url streams: MKVSupportedMay not playSupported
proxyHeaders.requestAll headersBest effortUser-Agent and Referer only
externalUrlOpens in your browser after you confirm; on a TV without a browser the link is shown as text. stremio:///… page links open the matching TS IPTV screen.
Torrent, Usenet, archive and YouTube streamsNot supported
Catalogues, genre filter, search, paging, series with seasons, live tv itemsSupported
configurable, configurationRequiredSupported Through the addon's configuration page in the browser.
adult, p2p hintsWarnings when adding; adult addons need an 18+ confirmation and are left out of Discover rows and search.
Continue watching and resume for addon films and episodesSupported
Subtitles, EPG addons (epgProvider), addon lists (addon_catalog), auto-play of the next episodeNot yet

TS IPTV has no built-in addons and does not suggest any. Addons can be disabled remotely only when a takedown request requires it.