M3U and M3U8 playlists
M3U is the most common IPTV playlist format: a plain text file where each channel is one description line and one link line. This page gives the full syntax TS IPTV reads, including the Kodi-style attributes.
TS IPTV includes no channels. It plays only the playlists you add. Every example uses example.com placeholders, a public test stream, or TS IPTV's own example files on tsiptv.web.app.
What M3U is
M3U started with the WinPlay3 and Winamp music players as a list of media locations, one per line. The IPTV community extended it into a channel list: each channel gets a name, a logo, a group and an identifier for the programme guide. These extensions are a shared convention, not a formal standard.
| Name | What it is |
|---|---|
| M3U | A plain list of locations, one per line, with no metadata. |
| Extended M3U | The first line is #EXTM3U, and each entry is preceded by an #EXTINF line. |
| M3U8 | The same format encoded as UTF-8. The .m3u8 extension signals UTF-8. |
HLS playlists are not IPTV channel lists
HLS streams also use .m3u8 files that start with #EXTM3U (RFC 8216), but those are the index of one stream, not a channel list:
| HLS media playlist | IPTV channel list | |
|---|---|---|
| An entry is | a 2–10 second segment of one stream | a channel (a link to that channel's stream) |
#EXTINF:<n> | segment duration in seconds | -1 or 0 (ignored) |
| Typical tags | #EXT-X-TARGETDURATION, #EXT-X-MEDIA-SEQUENCE, #EXT-X-STREAM-INF | only #EXTM3U |
Attributes on #EXTINF | none | tvg-id="…", group-title="…" and others |
| Who opens it | the video player, automatically | you, when you add a playlist |
If you paste the link of an HLS stream into TS IPTV, the app recognises it and asks “This is a single stream”: choose Add as channel to create a playlist with exactly one channel.
Syntax
#EXTM3U [header attributes]
#EXTINF:-1 [key="value" ...],<Channel name>
[#EXTGRP:<group>]
[#EXTVLCOPT:<option>=<value>]
[#KODIPROP:<property>=<value>]
<stream URL>[|Header=Value&Header=Value]
The first line is #EXTM3U. Each channel starts with an #EXTINF line, may have a few option lines, and ends with the link line. Parts in square brackets are optional. Lines that start with # but are not a known tag are comments.
Attributes on the #EXTM3U line
| Attribute | Meaning |
|---|---|
x-tvg-url | XMLTV guide URL. Several URLs may be separated by commas; TS IPTV downloads all of them (up to 5) and merges them. |
url-tvg | Older name for x-tvg-url. Read only when x-tvg-url is absent. |
tvg-shift | Default guide time shift in hours (for example +2, -4.5) for channels that do not set their own. |
catchup, catchup-days, catchup-source, catchup-correction | Default catch-up values for channels that do not set their own. See catch-up in the Kodi guide. |
Attributes on the #EXTINF line
Each attribute is key="value", with the value in straight double quotes. Attribute names are case-insensitive (tvg-ID is read as tvg-id). All attributes go before the comma; the channel name follows it.
| Attribute | Required | Meaning |
|---|---|---|
| (name after the comma) | yes | The channel's display name: the text after the first comma that is outside quotes, so names may contain commas. |
tvg-id | recommended | Identifier that links the channel to <channel id> in the XMLTV guide. Usually ChannelName.country, for example ExampleNews.us. |
tvg-name | no | Alternative name used only for guide matching; it does not replace the display name. |
tvg-logo | no | Logo image URL (PNG, JPG or SVG). |
group-title | no | The channel's group. Separate several groups with semicolons: group-title="News;HD" puts the channel in both. |
tvg-chno (or ch-number) | no | Channel number, an integer. Shown before the channel name. |
tvg-shift | no | Guide time shift for this channel only, in hours. |
radio | no | "true" marks a radio station: it gets a radio icon and the player shows its logo instead of a video area. |
media | no | "true" marks an on-demand video instead of a live channel. |
catchup, catchup-days, catchup-source, catchup-correction | no | Catch-up information. Stored; playback of past programmes comes later. |
user-agent, referrer | non-standard | Some generators write headers as attributes. TS IPTV reads them, but prefer #EXTVLCOPT or the | suffix below. |
#EXTGRP
#EXTGRP:Group name is another way to set a group, and it works two ways:
- Inside a channel (after
#EXTINF, before the link): applies to that channel if it has nogroup-title. - Before channels: becomes the default group for every following channel without a
group-title, until an empty#EXTGRP:line or the end of the file.
#EXTVLCOPT
| Line | Meaning |
|---|---|
#EXTVLCOPT:http-user-agent=… | User-Agent header for this stream. |
#EXTVLCOPT:http-referrer=… | Referer header for this stream (note the spelling referrer with two r's; http-referer is accepted too). |
| other keys | Stored, no effect. |
Headers after |
You can attach HTTP headers right after the link, Kodi style: https://cdn.example.com/live.m3u8|User-Agent=Mozilla%2F5.0&Referer=https%3A%2F%2Fexample.com%2F.
- TS IPTV splits at the first
|: the left part is the stream URL, the right part isName=Valuepairs joined with&. - URL-encode the values (
/becomes%2F,:becomes%3A, a space becomes%20). Unencoded values are accepted as long as they contain no&. - When the same header is set in several places, the order of priority is: the
|suffix, then#EXTVLCOPT, then#KODIPROP, then non-standard attributes.
#KODIPROP
#KODIPROP:key=value lines come from Kodi. They declare the stream type (mimetype), headers and DRM (Widevine, PlayReady, ClearKey). Each key and its platform support is described in the Kodi formats guide.
Complete example
This is TS IPTV's example file. The first channel really plays (the Mux public test stream, Big Buck Bunny © Blender Foundation, licensed CC BY 3.0); the other channels use example.com placeholders to show the syntax.
#EXTM3U x-tvg-url="https://tsiptv.web.app/examples/guide.xml"
#EXTINF:-1 tvg-id="HlsTest.example" tvg-chno="1" group-title="Test",HLS Test Channel
https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8
#EXTINF:-1 tvg-id="ExampleNews.us" tvg-chno="2" tvg-logo="https://example.com/logos/news.png" group-title="News;HD",Example News
#EXTVLCOPT:http-user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64)
#EXTVLCOPT:http-referrer=https://example.com/
https://cdn.example.com/news/index.m3u8
#EXTINF:-1 tvg-id="ExampleSports.us" tvg-chno="3" group-title="Sports",Example Sports
https://cdn.example.com/sports/index.m3u8|Referer=https%3A%2F%2Fexample.com%2F
#EXTINF:-1 tvg-id="ExampleRadio.us" tvg-chno="4" radio="true" group-title="Radio",Example Radio
https://cdn.example.com/radio/stream.aac
#EXTINF:-1 tvg-id="ExampleProtected.us" tvg-chno="5" group-title="DRM demo",Example Protected
#KODIPROP:inputstream.adaptive.license_type=com.widevine.alpha
#KODIPROP:inputstream.adaptive.license_key=https://license.example.com/widevine|Content-Type=application%2Foctet-stream|R{SSM}|R
#KODIPROP:mimetype=application/dash+xml
https://cdn.example.com/protected/manifest.mpd
#EXTINF:-1 tvg-id="ExampleArchive.us" tvg-chno="6" catchup="shift" catchup-days="3" group-title="Archive",Example Archive
https://cdn.example.com/archive/index.m3u8
Part by part:
- Line 1: the
#EXTM3Uheader, withx-tvg-urlpointing to the example XMLTV guide. - HLS Test Channel: the simplest channel: one
#EXTINFline with an id, a number and a group, then the link. - Example News: in two groups (
News;HD), with a logo, sendingUser-AgentandRefererthrough two#EXTVLCOPTlines. - Example Sports: sends
Refererwith the|suffix, URL-encoded. - Example Radio:
radio="true"marks a radio station. - Example Protected: a Widevine-protected DASH stream, declared with three
#KODIPROPlines (see the Kodi guide). - Example Archive: declares
shiftcatch-up for 3 days.
The smallest valid playlist has three lines:
#EXTM3U
#EXTINF:-1,My Channel
https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8
If you have a single stream and want to keep it as a file, you can also use a .strm file: see .strm files in the Kodi guide.
Create one by hand
- Open a plain-text editor: Notepad (Windows), TextEdit in plain text mode (macOS) or VS Code. Do not use Word or Google Docs.
- Type
#EXTM3Uon the first line. - For each channel, add two lines:
#EXTINF:-1 <attributes>,<Name>and then the stream URL. - Use straight double quotes
"around attribute values, not curly quotes“ ”. - Save as UTF-8 (in Notepad: Save as › Encoding: UTF-8; UTF-8 without BOM is best), with the extension
.m3uor.m3u8. - Test each stream URL before you share the file, for example in VLC: Media › Open Network Stream.
Host it
Any link that returns the file itself works. The server may send Content-Type audio/x-mpegurl, application/vnd.apple.mpegurl or text/plain; TS IPTV detects the content.
| Option | URL shape |
|---|---|
| GitHub (raw file) | https://raw.githubusercontent.com/<user>/<repo>/<branch>/playlist.m3u |
| GitHub Pages | https://<user>.github.io/<repo>/playlist.m3u |
| Any static host (Netlify, Cloudflare Pages, your own nginx…) | https://www.example.com/playlist.m3u |
| Dropbox | Change dl=0 at the end of the share link to dl=1 so it returns the file, not a preview page. |
| A file on your device | No hosting needed: use Import from file in TS IPTV. |
What does not work: Google Drive or OneDrive share pages, Dropbox preview links (dl=0), and GitHub links of the form github.com/<user>/<repo>/blob/…. They return a web page, not the file. Use the Raw or direct-download link instead.
- HTTPS is recommended. TS IPTV also opens
http://links, but then anyone on the network path can read or change the file. - CORS: TS IPTV is an installed app and needs no CORS headers. Add
Access-Control-Allow-Origin: *only if web-based players should read the file too. - Playlists added by link are downloaded again when you refresh. Keep the URL stable and edit the file in place.
Add it in TS IPTV
On phones, tablets and desktop
- Open Add IPTV Source (the Add IPTV button on the home screen).
- Enter a Source Name, for example “My channels”.
- Paste the link into Source Link and choose Add IPTV. Or choose Import from file and pick an
.m3u/.m3u8file on your device (up to 20 MB). - When the import finishes, TS IPTV shows how many channels it found. If entries were skipped, you also see “N entries could not be imported” and a Details button listing the reasons: a Kodi add-on is needed (
plugin://), web-page scraping, or no stream link.
On Android TV
- Open the import dialog and use the arrow keys to move between the name, the link and the add button.
- Type the link with the on-screen keyboard (or your phone's keyboard, if your TV supports it).
- Import from file appears only if the TV has a file picker; most TVs do not, so use a link.
Playlists imported from a file do not refresh on their own: import the file again after you edit it.
Common mistakes
| Mistake | Symptom | Fix |
|---|---|---|
Something other than #EXTM3U/#EXTINF at the start (an HTML page, other text) | Not recognised as a playlist | Make #EXTM3U the very start of the file. |
The link is a web page (a share page, a GitHub blob/ URL) | “This link opens a web page, not a playlist” | Use the raw or direct-download link. |
Curly quotes “ ” inserted by a word processor | Logos and groups missing | Retype them as straight ". |
| No comma before the name, or attributes after the name | The name shows as tvg-id="…", or there is no name | Write #EXTINF:-1 attributes,Name; nothing after the name. |
The link is on the same line as #EXTINF | The channel has no stream | The link goes on its own line. |
Unencoded space or | in the link | 404 or 400 errors | Encode spaces as %20; use | only for the header suffix. |
Headers written as attributes (user-agent="…") | The server still refuses on some players | Use #EXTVLCOPT:http-user-agent=… or the |User-Agent=… suffix. |
| Saved as ANSI/Windows-1252 with accented names | Garbled names (é) | Save again as UTF-8. |
tvg-id matches no XMLTV <channel id> | No programme guide | Copy ids exactly; they are case-sensitive. |
| An HLS stream imported as a channel list | Hundreds of “channels” named after segment numbers | Choose Add as channel in the single-stream dialog, or import the real channel list. |
Links with temporary tokens (?token=…) | Works today, fails tomorrow | Tokens expire by design; get a fresh list from your provider. |
plugin://… entries | Skipped, listed in the import details | These are Kodi add-ons, not streams; TS IPTV cannot run them. See the Kodi guide. |
What TS IPTV supports
| Feature | Android | iOS | Desktop |
|---|---|---|---|
| M3U, extended M3U, M3U8, gzip-compressed files | Supported | Supported | Supported |
Several groups, #EXTGRP, channel numbers, radio | Supported | Supported | Supported |
Several guides in x-tvg-url, tvg-shift | Supported | Supported | Supported |
Per-channel headers (#EXTVLCOPT, |, #KODIPROP) | All headers | Best effort | User-Agent and Referer only |
DASH .mpd streams without DRM | Supported | Supported through the built-in VLC player; only the User-Agent and Referer headers are sent | Supported |
| DRM (Widevine, PlayReady, ClearKey) | Android only | Not supported | Not supported |
| Catch-up | Stored, playback coming later | ||
rtmp, rtsp, udp… streams | Imported unchanged; whether they play depends on each platform's player. | ||
plugin:// and #WEBPROP entries | Not supported Skipped and listed in the import details. | ||