Skip to content

M3U format

Sharkiller edited this page Sep 29, 2023 · 6 revisions

🔴 M3U list player

image image

🔴 #EXTM3U

This header is required to be the first line on a M3U list.

It can contain one, all or none of the following tags in the same line separated by a space.

🟡 url-tvg="{comma separated URLs}"

This tag is used to list the URLs of the EPGs that will be used to display the programs on the channel list.
It can be one or multiple URLs separated by a comma.
The URL can return a raw XMLTV text or a compressed XMLTV gzip.

Example: url-tvg="https://domain1.com/epg1.xml,https://domain2.com/epg2.xml.gz"

🟡 player-buffer="{number in seconds}"

This setting overwrite the global buffer for all channels in this playlist, even the buffer that is configured inside the channel manifest.
This is useful to fix channels that buffer constantly or never load, or to lower it to load the channel faster when the buffer is too big.
This can also be configured per channel.

Example: player-buffer="30"

🟣 Full example line

#EXTM3U player-buffer="20" url-tvg="https://domain1.com/epg1.xml,https://domain2.com/epg2.xml.gz"

🔴 Channel block examples with all options

🟡 Clearkey

#KODIPROP:inputstream.adaptive.license_type=clearkey
#KODIPROP:inputstream.adaptive.license_key=0123456789abcdef0123456789abcdef:fedcba9876543210fedcba9876543210
#EXTINF:-1 tvg-logo="https://domain1.com/logos/channel1.png" group-title="News",Channel 1
https://domain1.com/live/channel1/manifest.mpd

🟡 Widevine

#KODIPROP:inputstream.adaptive.license_type=com.widevine.alpha
#KODIPROP:inputstream.adaptive.license_key=https://myserver.com/widevine
#EXTINF:-1 tvg-logo="https://domain1.com/logos/channel1.png" group-title="News",Channel 1
https://domain1.com/live/channel1/manifest.mpd

🟡 Widevine with separate certificate

#KODIPROP:inputstream.adaptive.license_type=com.widevine.alpha
#KODIPROP:inputstream.adaptive.license_key=https://myserver.com/widevine
#KODIPROP:inputstream.adaptive.server_certificate=https://myserver.com/widevine/certificate
#EXTINF:-1 tvg-logo="https://domain1.com/logos/channel1.png" group-title="News",Channel 1
https://domain1.com/live/channel1/manifest.mpd

🟡 Customized headers

#KODIPROP:inputstream.adaptive.stream_headers=origin=https://videoplayer.com
#KODIPROP:inputstream.adaptive.stream_headers=referer=https://videoplayer.com/
#KODIPROP:inputstream.adaptive.stream_headers=user-agent=Mi UserAgent Personalizado/137.0
#EXTINF:-1 tvg-logo="https://domain1.com/logos/channel1.png" group-title="News",Channel 1
https://domain1.com/live/channel1/manifest.mpd
#EXTVLCOPT:http-origin=https://videoplayer.com
#EXTVLCOPT:http-referrer=https://videoplayer.com/
#EXTINF:-1 tvg-logo="https://domain1.com/logos/channel1.png" group-title="News",Channel 1
https://domain1.com/live/channel1/manifest.mpd

🟡 Force video format

#KODIPROP:inputstream.adaptive.file_type=mpd
#EXTINF:-1 tvg-logo="https://domain1.com/logos/channel1.png" group-title="News",Channel 1
https://domain1.com/live/channel1.php

🟡 All options

#KODIPROP:inputstream.adaptive.stream_headers=origin=https://videoplayer.com
#KODIPROP:inputstream.adaptive.stream_headers=referer=https://videoplayer.com/
#KODIPROP:inputstream.adaptive.stream_headers=user-agent=My Custom UserAgent/137.0
#EXTVLCOPT:http-origin=https://videoplayer.com [OPTIONAL]
#EXTVLCOPT:http-referrer=https://videoplayer.com/ [OPTIONAL]
#EXTINF:-1 player-buffer="5" tvg-id="Channel1.us" tvg-logo="https://domain1.com/logos/channel1.png" group-title="News",Channel 1
https://domain1.com/live/channel1/manifest.mpd

🟢 #KODIPROP:inputstream.adaptive.file_type=

When the video link does not end in a recognized format, such as .php or lacks an extension, it is necessary to assign the correct format of the content.
Supported values: mpd, m3u8.

🟢 #KODIPROP:inputstream.adaptive.stream_headers=

Used to list the headers you want to modify. Can be used multiple times for all headers needed.
Format {header}={value}.

🟢 #KODIPROP:inputstream.adaptive.license_type=

Supported values: clearkey, org.w3.clearkey, widevine y com.widevine.alpha

🟢 #KODIPROP:inputstream.adaptive.license_key=

🔵 For Clearkey (clearkey y org.w3.clearkey)

Supported formats:

0123456789abcdef0123456789abcdef:fedcba9876543210fedcba9876543210

"0123456789abcdef0123456789abcdef":"fedcba9876543210fedcba9876543210"

{"0123456789abcdef0123456789abcdef":"fedcba9876543210fedcba9876543210"}
{"keys":[{"kty":"oct","k":"/ty6mHZUMhD+3LqYdlQyEA","kid":"ASNFZ4mrze8BI0VniavN7w"}],"type":"temporary"}

Multiple keys are also supported:

{
    "0123456789abcdef0123456789abcdef":"fedcba9876543210fedcba9876543210", 
    "fedcba9876543210fedcba9876543210":"0123456789abcdef0123456789abcdef"
}
{"keys":[
    {"kty":"oct","k":"/ty6mHZUMhD+3LqYdlQyEA","kid":"ASNFZ4mrze8BI0VniavN7w"},
    {"kty":"oct","k":"ASNFZ4mrze8BI0VniavN7w","kid":"/ty6mHZUMhD+3LqYdlQyEA"}
],"type":"temporary"}

URL that returns any of the above formats:

https://servidor-de-clearkey.com/channel1.php

If a valid format is not returned by the url then it make a POST to the same url with key ids data in EME spec request format:

{"kids":[
    "ASNFZ4mrze8BI0VniavN7w",
    "/ty6mHZUMhD+3LqYdlQyEA"
],"type":"temporary"}

That need to respond with a valid EME spec license format:

{"keys":[
    {"kty":"oct","k":"/ty6mHZUMhD+3LqYdlQyEA","kid":"ASNFZ4mrze8BI0VniavN7w"},
    {"kty":"oct","k":"ASNFZ4mrze8BI0VniavN7w","kid":"/ty6mHZUMhD+3LqYdlQyEA"}
],"type":"temporary"}

🔵 For Widevine (widevine y com.widevine.alpha)

Widevine server URL

Example: #KODIPROP:inputstream.adaptive.license_key=https://myserver.com/widevine

🟢 #KODIPROP:inputstream.adaptive.server_certificate=

If the Widevine server requires a separate URL to obtain the encryption certificate it can be configured with this line.

Example: #KODIPROP:inputstream.adaptive.server_certificate=https://myserver.com/widevine/certificate

🟢 #EXTVLCOPT:http-origin/referrer

For compatibility only. It is preferable to use #KODIPROP:inputstream.adaptive.stream_headers=

🟢 #EXTINF:-1 {tags...},Channel name

Channel information.
It can contain one or all the following tags in the same line separated by a space.

🔵 tvg-logo

URL of the channel logo to be used in the channel list.

🔵 group-title

Name of the channel group.

🔵 tvg-id

ID to link the channel to the EPG data.

🔵 player-buffer

A number in seconds to overwrite the default channel buffer.

🟣 Line example with all tags

#EXTINF:-1 player-buffer="5" tvg-id="Channel1.us" tvg-logo="https://domain1.com/logos/channel1.png" group-title="News",Channel 1

🔴 URL parameter &m3u-order

If the &m3u-order parameter is present in the .m3u list URL, the channels will be sorted in the following order:

Alphabetically by group-title and inside them alphabetically by channel name.

🔴 URL parameter &epg-disable

If the &epg-disable parameter is present in the .m3u list URL the parser will ignore the EPGs even when global EPG setting is enabled in the extension.

🔴 URL parameter &epg-enable

If the &epg-enable parameter is present in the .m3u list URL the parser will generate the EPGs programming even when global EPG setting is disabled in the extension.