Feature #1137
IPTV channel import by M3U file
0%
Description
It would be nice if it was possible to import all IPTV channels at once by importing an M3U file like MythTV already can. With 138 channels it's really a lot of work adding them one by one
The contents are like this:
#EXTM3U #EXTINF:0,1 - Nederland 1 udp://@233.81.233.1:4321 #EXTINF:0,2 - Nederland 1 HD udp://@239.192.27.2:1234 #EXTINF:0,3 - Nederland 2
Files
History
Updated by Adam Sutton about 12 years ago
There has been a recent discussion about this on #hts. However no-one was aware of a commonly supported format that was being used for IPTV channel lists (at least not officially, i.e. by the providers themselves). But then most of those chatting (myself included) aren't IPTV users.
Can you provide a link to a description of how the M3U file is used (i.e its format). It's looks like its fairly straightforward, I'm guessing from your sample its something like:
#EXTINF:0,CHANNEL_NO - CHANNEL NAME
CHANNEL_SPEC
but is it possible to have extra options?
The simplest (interim) solution, would be a simple python script that will convert M3U into a set of TVH config files. You'd have to run the script with TVH switched off, but it would only be a few mins to write such a script and would be a reasonable solution for the short term.
Adam
Updated by Djuri Baars about 12 years ago
The things that are relevant are like you described. The by MythTV supported format was first seen on the FreeBox (french). It is based on the Winamp M3U format.
Full example: http://www.mythtv.org/wiki/Sasktel_IPTV_Regina_Channels
More generic info and examples about M3U: http://en.wikipedia.org/wiki/M3U
Official specification: http://schworak.com/blog/e39/m3u-play-list-specification/ (not currently available, see below for explanation with an MP3 file)
#EXTM3U #EXTINF:233,Everclear - So Much For The Afterglow Alternative\everclear_SMFTA.mp3 #EXTINF:227,Weird Al - Everything You Know Is Wrong Comedy\Weird_Al_Everything_You_Know_Is_Wrong.mp3 #EXTINF:187,Weird Al Yankovic - This is the Life Weird_Al_This_Is_The_Life.mp3 #EXTINF:129,Weird Al: Bad Hair Day - Gump http://www.site.com/~user/gump.mp3 #EXTINF:-1,My Cool Stream http://www.site.com:8000/listen.pls ... #EXTINF:233,Everclear - So Much For The Afterglow This is the line that tends to confuse people. Let's break it up into parts #EXTINF: This signifies this is an Extended Information field. It ends with a colorn. 233, This is the time of the file in seconds followed by a comma. (233 seconds = 3:53). On the last entry there is a negative one, this is usually seen on streams, it tells the program to ignore the time entry. Everclear - So Much For The Afterglow Title to display. This is usually the title read from the file name or ID3 tags. This also can be the name of a stream. No characters follow the title. Alternative\everclear_SMFTA.mp3: File location as described above with basic playlists.
Updated by Marko Zupancic about 12 years ago
There is a program that makes your life much easier. But it was written for previous versions of TVHEADEND so little upgrade would be nice. There is a source so somebody with programming skills could easily manage it.
For example:
This program transfers m3u to iptvservices with following content.
It still shows channel if you import it but under /home/pi/.hts/tvheadend/iptvservices
======================================================
{
"pmt": 0,
"port": 5000,
"interface": "eth0",
"group": "239.1.1.9",
"channelname": "POP TV",
"mapped": 1,
"pcr": 0,
"disabled": 0
}
======================================================
NEW TVHEADEND 3.1.651.g00fa2 however uses little different iptvservices content
======================================================
{
"pmt": 2014,
"stype": 1,
"port": 5000,
"interface": "eth0",
"group": "239.1.1.9",
"channelname": "POP TV",
"mapped": 1,
"pcr": 2010,
"disabled": 0,
"stream": {
"pid": 2010,
"type": "MPEG2VIDEO",
"position": 0,
"width": 720,
"height": 576
},
"stream": {
"pid": 2011,
"type": "MPEG2AUDIO",
"position": 1,
"language": "slv"
},
"stream": {
"pid": 2013,
"type": "TELETEXT",
"position": 2
}
}
======================================================
If i quote user TheHijacker:
" All that you see needs to inputted manually via WebGUI. No way I am doing this one by one. So I made a tool to make this a little less complicating.
I simply provide him m3u playlist and he makes all the needed files that I copy into tvheadend profile folder using OpenELEC samba share. That includes the tags, IPTV streams and from that channels. This saved me hours of manual input inside WebGUI. "
Cool thing about it that from m3u list it:
1. Prepares IPTV channels
2. Prepares Channel Tags
3. Finds Channel icons
m3u list has to be like this
======================================================
#EXTM3U
#EXTNAME: T2
#EXTINF:1,SLO 1
#EXTTV:Nacionalni;slovenski;SLO1
udp://@239.1.1.115:5000
#EXTINF:2,SLO 2
#EXTTV:Nacionalni;slovenski;SLO2
udp://@239.1.1.116:5000
#EXTINF:3,Kanal A
#EXTTV:Nacionalni;slovenski;KANALA
udp://@239.1.1.8:5000
#EXTINF:4,POP TV
#EXTTV:Zabavni;slovenski;POPTV
udp://@239.1.1.9:5000
======================================================
Program and instructions available on http://forum.xtreamer.net/topic/23093-how-to-set-up-tvheadend-iptvdvb-t-streaming .
You have to register first to see topic "How to set-up TVheadend + IPTV/DVB-T streaming".
Updated by ddkserv none almost 12 years ago
Hi all,
I am a IPTV user and I generate my own m3u file.
First of all the IPTV interface on the admin IPTV interface require the following :
[Enabled],[Channel name],[interface],[Group],[UDP Port]
On the admin Channel interface require the following after filling out the IPTV admin interface:
[Program Number]
Officially m3u file is very limited format but can easier extend so more can be automation if needed.
#EXTM3U
#EXTINF - extra info - length (seconds), artist '-' title
[Path: Local (absolute or relative) or URL]
I would suggest to use for a first go:
#EXTM3U
#EXTINF:0,001[Program Number] - BBC[Program Name]
udp://@127.0.0.1[Group]:9090[UDP Port]/
The reason for picking this format above is that one can still can test if the M3U file work via VLC or any other UDP enabled player plus MythTV migration would be easier.
In the given format one need to take [Program Name],[Group] and [UDP Port] into the IPTV part of the admin interface.
Enabled should be turn on and Ethernet should always be eth0.
[Program Number] is used in the Channel admin interface.
One can always extend the format to have [Icon URL] and [Radio indication]
My suggestion is that it could look like this:
#EXTM3U
#EXTINF:0,001[Program Number] - BBC[Program Name] - 0[1=Radio,0=IPTV] - 127.0.0.1/bbc.jpg[Icon URL]
udp://@127.0.0.1[Group]:9090[UDP Port]/
#EXTINF:0,001[Program Number] - BBC Radio[Program Name] - 1[1=Radio,0=IPTV] - 127.0.0.1/bbc_radio.jpg[Icon URL]
udp://@127.0.0.1[Group]:9090[UDP Port]/
Anyway, I would love to have this feature integrated into the admin webgui ASAP with minimal support so if do not need to enter each entry manually.
Updated by Cristian Magherusan-Stanciu almost 12 years ago
marko giurgiev Zupancic: that forum post no longer exists, or I am unable to find it.
I atarted writing such a script myself(generating the iptv_* files), but for some reasons tvheadend doesn't like those.
I can share the code upon request.
Am I missing something?
Updated by Marko Zupancic almost 12 years ago
It is still there, just checked. You just have to register and login first.
But if you are having problems, get it from link below.
Updated by Сергей Ворожбит almost 12 years ago
Marko Zupancic, your script well works!
Please add a binding to epggrab.
IPTV.m3u playlist of my provider.
Updated by Adrien CLERC almost 12 years ago
- File freebox-playlist.m3u freebox-playlist.m3u added
I have develop a python script which is able to do the following:
- Parse the file and gather them in a dictionnary. The playlist have sd and hd channels mixed, along with radio, that's why this step is needed.
- Optionnally extract channel icons from a web page.
- Add IPTV channels into TVHeadend using the POST-JSON API.
- Optionnally modify a tv_grab_fr_telerama.conf to enable only imported channels. (TVHeadend will link them automatically).
This script is hosted at https://github.com/Glandos/m3u_to_tv. It is somewhat modular, but it just fits my needs for now, so it's not really generic for now. I'd really appreciate if you want to extend it.
Have fun.
Updated by Frederik Niedernolte almost 12 years ago
- File vs-playlist-hts.m3u vs-playlist-hts.m3u added
I have got a Raspberry Pi today and installed Raspbmc with Tvheadend.
I am completely new to this and I would like to watch and record my Virtualsat channels (www.virtualsat.eu) with it.
Virtualsat creates a m3u file with this example content:
#EXTM3U
#EXTINF:0,KIKA
http://vstv.virtualsat.eu:1935/hq/9203/playlist.m3u8?username=encrypteduser=&password=encryptedpassword=
#EXTINF:1,ZDF
http://vstv.virtualsat.eu:1935/hq/9201/playlist.m3u8?username=encrypteduser=&password=encryptedpassword=
It also creates an EPG as XML file: https://www.virtualsat.eu/epg/ausgabe.xml
Is it possible to add these channels to Tvheadend and if so, how?
Thanks!
Updated by Alexandre CHAPPAZ almost 12 years ago
@Adrien CLERC
hi,
I did run successfully your script and it populated IPTV & CHANNELS, but in my understanding, thveadend does not support rtsp as of the current version. Is that right?
Looks like older version of tvheadend could manage this type of source, but the feature was removed. Could you point me to a specific version able to read the freebox streams?
Thanks
Alex
Updated by FuN KeY over 8 years ago
Jaroslav Kysela wrote:
Implemented in 4.1.
This is good news! Any hint how I could use it? I did just update to 4.1 but I did not find any reference to this feature.
Updated by Jaroslav Kysela over 8 years ago
Create 'IPTV auto network', enter your m3u URL as the source of muxes for this network.
Updated by FuN KeY over 8 years ago
Ho, my bad. I was using 4.1 from unstable, which seems far behind from master.
Thank you!
Updated by Joe User over 8 years ago
FuN KeY wrote:
Ho, my bad. I was using 4.1 from unstable, which seems far behind from master.
Thank you!
I guess you are using the old repository since on the new repository (https://bintray.com/tvheadend) unstable and master are the same.
The original request asks for support for importing an m3u "file" - is that possible, or only possible to import from a URL?
Updated by Joe User over 8 years ago
B C wrote:
file:///location/of/file.m3u
I had tried that already and it was not working, that is why I asked.
After looking at the code, I see now that the location of the file has to be on the server where TVHeadend is running. I was trying to upload a local file from where the web client is running on another PC. That would be more convenient for me, since on the client I already have m3u files which are used with vlc, etc. But it is not so difficult to transfer the m3u files to the server.
Updated by Federico Cuello almost 8 years ago
It was not working for me, but I fixed here https://github.com/tvheadend/tvheadend/pull/912 and it got merged.
Updated by nf gb almost 6 years ago
Federico Cuello wrote:
It was not working for me, but I fixed here https://github.com/tvheadend/tvheadend/pull/912 and it got merged.
Hi,
This is working for however I've an issue. I have a playlist (http://lista.kodiportugal.com) which I can't use directly in tvheadend. Each time I try to create an automatic network with it, tvheadend restarts. The only solution is to save the playlist in an web server with the .m3u extension and then create from that file.
The problem is that some of the channel links are valid only for some hours, so the playlist must be updated every few hours.
I believe the problem is the file not having m3u extension. Is it possible for tvheadend to accept playlists without the extension? I'm not the owner of the playlist so I can't change the file.
Best Regards,
Updated by nf gb almost 6 years ago
Quote
Federico Cuello wrote:
It was not working for me, but I fixed here https://github.com/tvheadend/tvheadend/pull/912 and it got merged.
Hi,
This is working for me, however I've an issue. I have a playlist (http://lista.kodiportugal.com) which I can't use directly in tvheadend. Each time I try to create an automatic network with it, tvheadend restarts. The only solution is to save the playlist in an web server with the .m3u extension and then create from that file.
The problem is that some of the channel links are valid only for some hours, so the playlist must be updated every few hours.
I believe the problem is the file not having m3u extension. Is it possible for tvheadend to accept playlists without the extension? I'm not the owner of the playlist so I can't change the file.
Best Regards,
Updated by saen acro almost 6 years ago
nf gb wrote:
Quote
Federico Cuello wrote:It was not working for me, but I fixed here https://github.com/tvheadend/tvheadend/pull/912 and it got merged.
Hi,
This is working for me, however I've an issue. I have a playlist (http://lista.kodiportugal.com) which I can't use directly in tvheadend. Each time I try to create an automatic network with it, tvheadend restarts. The only solution is to save the playlist in an web server with the .m3u extension and then create from that file.
The problem is that some of the channel links are valid only for some hours, so the playlist must be updated every few hours.
I believe the problem is the file not having m3u extension. Is it possible for tvheadend to accept playlists without the extension? I'm not the owner of the playlist so I can't change the file.Best Regards,
Make cron task with will store output to playlist.m3u localy,
then poin tvh iptv automatic network to this file.