Converting tvheadend configuration to VDR channels.conf
#1
I made a Python script to convert tvheadend channel configuration to VDR channels.conf format. In case anyone else might find it useful I've put it up on github at

https://github.com/LS80/tvheadend2vdr

It's an alternative to using other scanning tools such as w_scan which for me were not detecting DVB-T2 channels. tvheadend does detect the DVB-T2 channels, hence the basis for this script.

github pull requests are welcome if anyone spots any issues with it. I've not tested it with DVB-S or DVB-C.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
#2
Hi. Great to see that. Maybe also you can create script for convert from vdr to tvh ? Would be very nice Smile
Reply
#3
Something similar is at https://github.com/grudolf/m3u2hts so it would be pretty simple to adapt that to parse the channels.conf instead.

I probably won't do it myself though because I moved from tvheadend to VDR to get a working timeshift.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
#4
Any noob -help with using this? Or do I just download this script to my kodi-machine, execute script by typing "tvheadend2vdr.py" at command prompt and it updates VDR channels.conf automatically?
Odroid C2 running CoreElec
Reply
#5
(2015-09-11, 13:00)BoxFreak Wrote: Any noob -help with using this? Or do I just download this script to my kodi-machine, execute script by typing "tvheadend2vdr.py" at command prompt and it updates VDR channels.conf automatically?
It depends what OS you are using on your Kodi machine. Are you running OpenELEC with the tvheadend backend add-on on the same machine? If so I have made a change to support this so if you ssh to your machine you can run

Code:
curl -O https://raw.githubusercontent.com/LS80/tvheadend2vdr/master/tvheadend2vdr.py
chmod +x tvheadend2vdr.py
./tvheadend2vdr.py -u root -p .kodi/userdata/addon_data/service.multimedia.tvheadend -o

Then you should have a channels.conf.

The script doesn't preserve the channel order or keep the channel groups from tvheadend. I will develop it further to do this if I can resolve my issue with EPG data in VDR.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
#6
Openelec yes. However I get this error because of https I think:

"wget: not an http or ftp url"
Odroid C2 running CoreElec
Reply
#7
(2015-09-11, 21:27)BoxFreak Wrote: Openelec yes. However I get this error because of https I think:

"wget: not an http or ftp url"

You must be running a different version because the wget works for me. You can use 'curl -O' instead.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
#8
(2015-09-11, 21:40)Leopold Wrote:
(2015-09-11, 21:27)BoxFreak Wrote: Openelec yes. However I get this error because of https I think:

"wget: not an http or ftp url"

You must be running a different version because the wget works for me. You can use 'curl -O' instead.

Linux-noob still having trouble here:

Code:
Traceback (most recent call last):
  File "./tvheadend2vdr.py", line 116, in <module>
    main()
  File "./tvheadend2vdr.py", line 110, in main
    args.outfile.writelines(output)
  File "./tvheadend2vdr.py", line 107, in <genexpr>
    output = (':'.join(map(str, channel)) + '\n' for channel in channels_conf)
  File "./tvheadend2vdr.py", line 86, in get_channels_conf
    *mux_config)
  File "./tvheadend2vdr.py", line 47, in get_channel_config
    name = "{};-".format(conf['svcname'])
KeyError: 'svcname'

And result is empty channels.conf. Huh
Odroid C2 running CoreElec
Reply
#9
Could you tar up your tvheadend config and upload it somewhere? Then I should be able to reproduce your issue.

Code:
tar cvjf .kodi/userdata/tvheadend.tar.bz2 .kodi/userdata/addon_data/service.multimedia.tvheadend/input/

Then you can grab tvheadend.tar.bz2 from the Userdata share and upload it to Dropbox or whatever you prefer.

Are you using terrestrial, cable, or satellite? I've only tested it with terrestrial.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
#10
Sent link to my settings with PM. I'm using terrestrial with Asus Chromebox, Sony PlayTV and MyGica T230 hd-tuners.
Odroid C2 running CoreElec
Reply
#11
Hi Leopold

I am having the exact same problem as BoxFreak, did you manage to overcome the problem?
Reply
#12
Does anyone know of a program to covert ver channel.conf to tvheadend?

thanks
joe
Reply

Logout Mark Read Team Forum Stats Members Help
Converting tvheadend configuration to VDR channels.conf0