I just had a discussion about this yesterday in another addon forum where someone had created an addon to tune in a live stream of an American network called Comet, which mostly features old MGM SciFi movies and shows. Apparently the addon scrapes the Comet live stream web page at
http://comettv.com/live.html and grabs the URL for the live stream, which is currently (as I write this)
http://content.uplynk.com/channel/810bf2...afc91.m3u8 - now I am told this may change but I'll use it as an example. So as I wrote in that thread, you have to have a version of TVHeadEnd that is new enough to support the pipe URL (late 3.9 versions or any 4.x version). Then you create an IPTV network if you don't have one already, and then you create a mux with the following parameters:
Enabled: (Check)
EPG Scan: Disable
Scan Status: PEND (it will change to IDLE after it has acquired the stream)
AC-3 Detection: Standard (the default)
URL: pipe://ffmpeg -loglevel fatal -i
http://content.uplynk.com/channel/810bf2...afc91.m3u8 -vcodec copy -acodec copy -flags +global_header -strict -2 -metadata service_provider=CometTV -metadata service_name=CometTV_Live_Stream -f mpegts pipe:1
Interface: (leave blank)
ATSC: (leave unchecked)
Mux Name: Comet
Service Name: (leave blank)
(Note you may need to right click and copy the full URL in the above pipe command because the forum software shows an abbreviated link)
After it scans the stream it should create a service which can be viewed in the Services tab, and then if you highlight that service and click on "Map Seletcted" it should create a channel. You can then go into the Channels tab and edit the channel name and number, etc. but in any case it should appear in the Kodi channels list. If you give it an EPG source then it should display in the grid as well. Wikipedia shows a list of Comet TV affiliates, you'd probably want to pick a Sinclair affiliate for guide data since Sinclair owns Comet TV.
https://en.wikipedia.org/wiki/List_of_Comet_affiliates
If it doesn't work check to see if ffmpeg is installed on your system, if you need a static build try
http://johnvansickle.com/ffmpeg/ - or, check to see if the URL has changed.
Now of course this will only work as long as the URL for the stream isn't changed, and I don't know of any way to get TVHeadEnd to insert a new URL into that pipe command if it changes. Perhaps there is some way to do it using Linux system variables but if so I don't know how. If they change the URL every few days, then obviously this is not going to work with any degree of reliability. Also, it appears this technique ONLY works with services sending m3u8 or similar types of streams. So while in this case it was not that difficult once I had the URL, for other services it might be much more difficult.
Unfortunately most channels with online streams don't make it nearly as easy. Many networks that have live streams on their web sites go out of their way to hide the actual link to the stream. Normally if you can find a stream that will play in VLC there is at leas a chance you can get it to work in TVHeadEnd, though you may need to pipe it through ffmpeg to convert it into the transport stream format that TVHeadEnd understands. I would really like to have a list of other live streaming channels (especially English language channels that can be accessed without geographic restriction from the USA, including channels that are in the USA or Canada) that could be mapped to a TVHeadEnd channel in this manner, but I suspect they are few and far between.
The other issue is sites that offer videos on demand. These are not live streams, but instead are individual videos of current and past programs. The holy grail for me would be to find a program that runs IN LINUX (NOT WINDOWS) that can grab these files as they appear and add them as recordings under TVHeadEnd, or make them available to Kodi in some other way. In other words think about video addons for Kodi such as SyFy, it will show you individual episodes such as (just as an example) the three part series Childhood's End. Each of these are two hour shows and I don't always have time to watch in one sitting, and if you have bandwidth caps you don't want to keep restarting them from the start. What I would like to find is a program or script that runs under Linux (I can't emphasize that enough) that could, in such a situation, watch the site for new episodes as they appear and when they do, either add them to your recordings directory in TVHeadEnd or in some other way make them available to your Kodi frontends. The real problem is parsing the site and finding the available shows and files (which the SyFy addon apparently can already do) and then watching a particular show's directory, maybe as a nightly cron job, and downloading new episodes of such programs as soon as they appear, and if necessary then running them through ffmpeg or whatever to get them into a format that TVHeadEnd or Kodi can deal with. Granted this is not the same as accessing a live stream, but the goal is the same, to make shows available on your schedule (even if you don't get around to watching them for a few months) and not force you to go to someone's web site using a web browser to watch them. And, of course, to be able to freely skip through parts you don't want to watch or go back to parts you missed without using extra bandwidth, since many ISP's will charge you extra if you go over your data cap.