Feature #6038

HDhomerun channel scan

Added by th0ma7 ^ about 1 year ago. Updated about 1 year ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


I'm using two HDhomerun (quatro and duo) which been working quite well with tvheadend.
In tvheadend the pre-defined muxes does not provide an exaustive list of all the channels that are available in my area. As such channel scanning is a bit painful (I ended-up generating my own dvb_channel.list using wscan + dvbv5-scan)

I tried Jellyfin a few weeks ago and was surprised by its ease of use (although I prefer tvheadend as more reliable). One interesting thing was how it manage hdhomerun: it has the ability to fetch the channel list from the remote adapter. As such it does not need to "scan" for muxes at all, it simply use the already scanned list using the devices API. Option are to use all channels or only favorites or discard disabled ones (as favorites & disable can be done from the admin web page on the hdhomerun).

All in all, it would be great if tvheadend had a similar behavior built-in which would simplify and futher automate the configuration and usage significantly.



Updated by th0ma7 ^ about 1 year ago

I was looking at various alternatives to automate this.

The easiest would be the following:
- Use IPTV automatic
- Use hdhomerun json mapping URL such as http://<IP>/lineup.json
- Modify TVH to support JSON on top of M3U

Other alternative could be:
- Create a .js script similar to
- Have the ability to call that page from the IPTV Automatic using http://localhost:9981/hdhomerun.html
- that page would provide a M3U listing of all LAN hdhomerun for TVH to use

The two options would alleviate the need of an added cron job to generate an M3U file, from which the IPTV Automatic setting is pointing to file://<path>

I've looked at the code and, I'm definitively not a C-coder... sigh.
I could probably create something such as a webpage with a .js script type-thing.

Interest from a developper to add JSON format to accepted URL would be just great.

Much thnx in advance for considering such feature.


Updated by th0ma7 ^ about 1 year ago

Hi all,

If within src/input/mpegts/iptv/iptv_auto.c:

Just before: if (!strncmp(data, "#EXTM3U", 7))

We could check if data if JSON type (such as using json-c):
if (json_tokener_parse(data) != NULL)

If it is then convert to M3U similar to jq query:

$ echo "#EXTM3U" && curl -s | jq -r '.[] | "#EXTINF:-1 tvg-chno=\"\(.GuideNumber)\" tvg-name=\"\(.GuideName)\",\(.GuideName)", "\(.URL)?duration=7200"'
#EXTINF:-1 tvg-chno="2.1" tvg-name="CBFT-DT",CBFT-DT
#EXTINF:-1 tvg-chno="3.1" tvg-name="WCAX-HD",WCAX-HD
#EXTINF:-1 tvg-chno="3.2" tvg-name="Movies!",Movies!
#EXTINF:-1 tvg-chno="3.3" tvg-name="Circle",Circle
#EXTINF:-1 tvg-chno="3.4" tvg-name="StartTV",StartTV
#EXTINF:-1 tvg-chno="3.5" tvg-name="ION TV",ION TV
#EXTINF:-1 tvg-chno="5.1" tvg-name="WPTZ-HD",WPTZ-HD
#EXTINF:-1 tvg-chno="5.3" tvg-name="Me TV",Me TV
#EXTINF:-1 tvg-chno="6.1" tvg-name="CBMT-DT",CBMT-DT
#EXTINF:-1 tvg-chno="10.1" tvg-name="CFTM-HD",CFTM-HD
#EXTINF:-1 tvg-chno="12.1" tvg-name="CFCF",CFCF
#EXTINF:-1 tvg-chno="15.1" tvg-name="CKMI",CKMI
#EXTINF:-1 tvg-chno="17.1" tvg-name="CIVM-DT",CIVM-DT
#EXTINF:-1 tvg-chno="22.1" tvg-name="WVNY-DT",WVNY-DT
#EXTINF:-1 tvg-chno="22.2" tvg-name="Laff",Laff
#EXTINF:-1 tvg-chno="22.3" tvg-name="Grit",Grit
#EXTINF:-1 tvg-chno="22.4" tvg-name="Quest",Quest
#EXTINF:-1 tvg-chno="24.1" tvg-name="CIVS-HD",CIVS-HD
#EXTINF:-1 tvg-chno="31.1" tvg-name="WNNE-HD",WNNE-HD
#EXTINF:-1 tvg-chno="33.1" tvg-name="VPBS-1",VPBS-1
#EXTINF:-1 tvg-chno="33.2" tvg-name="VPBS-2",VPBS-2
#EXTINF:-1 tvg-chno="33.3" tvg-name="VPBS-3",VPBS-3
#EXTINF:-1 tvg-chno="33.4" tvg-name="VPBS-4",VPBS-4
#EXTINF:-1 tvg-chno="35.1" tvg-name="CFJP-DT",CFJP-DT
#EXTINF:-1 tvg-chno="44.1" tvg-name="WFFF-DT",WFFF-DT
#EXTINF:-1 tvg-chno="44.2" tvg-name="CourtTV",CourtTV
#EXTINF:-1 tvg-chno="44.3" tvg-name="Bounce",Bounce
#EXTINF:-1 tvg-chno="44.4" tvg-name="Antenna",Antenna
#EXTINF:-1 tvg-chno="47.1" tvg-name="CFHD-DT",CFHD-DT
#EXTINF:-1 tvg-chno="57.1" tvg-name="MLPBSHD",MLPBSHD
#EXTINF:-1 tvg-chno="57.2" tvg-name="NHK-WOR",NHK-WOR
#EXTINF:-1 tvg-chno="57.3" tvg-name="MLKIDS",MLKIDS
#EXTINF:-1 tvg-chno="62.1" tvg-name="CJNT",CJNT


Updated by th0ma7 ^ about 1 year ago

Heads-up, I had also sent out a support request to sillicondust in order to modify hdhomerun firmware to have a lineup.m3u page on top of the existing lineup.json.

I've received a positive return on my request which will be passed along to the development team and see if it can be accomodated.

So never know, in turn this feature request in TVH may not be needed afterwads? I'll follow-up if things turns out positively.

Also available in: Atom PDF