Project

General

Profile

Channel and Tags Config

Added by Nathan Thirlby about 11 years ago

I'm looking at creating a service to allow quick easy config of channel mappings. For example you'll be able to select Sky UK London HD or Sky UK East Midlands SD and it will replicate the SKY UK channels for you.

Now on the importing side you would need to Add the DVB Network by location (including adding your dvb device) but am i correct in thinking once this is done you can add the files in the channel and channeltags folders to restore the config?


Replies (9)

RE: Channel and Tags Config - Added by gary tan about 11 years ago

Maybe try the irc channel to get a reply to your query. On enigma2 receivers they have an Auto bouquet updater that basically keeps channels up to date when they change frequency. It would be great to have some that better manages channels as its currently a nightmare for me anyways.

RE: Channel and Tags Config - Added by Indridi Bjornsson about 11 years ago

Hi Nathan,

I spent a long time googling for information on how to create Sky channel list and didn't find much. I therefore decided to do this my self.
Being lazy I decided to write a script instead of doing this by hand but ended up spending an awful lot of time doing this. The upside to this however is that I can
now create all the channels from scratch so I don't have to worry about messing up my config.
The script I wrote generates all the Sky channels, with correct channel id's, HD swapping, sky channel tagging (movies/sports/kids...), and also renames icon files if needed.
I used the list of sky channels that I found at: http://www.channelwiki.org/wiki/List_of_channels_on_Sky_(UK_&_Ireland)
The TV icons I got from: http://www.team-mediaportal.com/extensions/tv-channels/uk-tv-radio-channel-logos

Before running the script I delete all the channels and then stop tvheadend. The script reads in the list I created of channels, reads channel tags from tvheadend/channeltags and all the transports from tvheadend/dvbtransports. It creates all the channels in tvheadend/channels and patches the needed transports.

After running the script I start tvheadend and lo and behold all the channels appear and tvheadend doesn't seem to care that I messed with the configuration.
I'm running tvheadend 3.5.243 using XMBC as frontend and as I said seems to be working fine at least with this version of tvheadend.

If you are interested I could post the script and the channel config file. I would however need some time cleaning up my code before posting it.

Regards,
Indridi

RE: Channel and Tags Config - Added by J. Rios almost 11 years ago

Indridi Bjornsson: Yes please, post the script. I was thinking about to do the same.

Regards

RE: Channel and Tags Config - Added by Indridi Bjornsson almost 11 years ago

Hi Rios,

Sorry for my late reply but I just discovered your mail.
I’ve attached the script along with the channel definition and the channel tags I’m using.

1. First of all take a backup of your current tvheadend setup. Even though this script works for me, it might mess things up for you. So please take a backup before you proceed. I will not take any responsibility if you mess up your configuration.

2. Make sure that in General Config for the EPG Grabber that update channel name, number and icon is unchecked else your channels will be renamed immitiatly.

3. Delete all the channels you have. From within the TVHeadend UI go to channels, select them all and delete.

4. Make sure that all your services are up to date for all the adapters you have. If you are not sure then just delete them all and go to the general tab and select “Map DVB services to channel…”

5. Stop TVHeadend service.

6. Extract the files from htsCreateChannel.tgz packet. I recommend extracting it to your .hts directory. That is where I keep them and the rest of these instructions will assume that you do.

7. If you want to use the same channel tags as I do remove your current channeltags directory and extract the channeltags.tgz packet. From within your .hts directory do the following:

$ rm -rf tvheadend/channeltags
$ tar xzf channeltags.tgz

Make sure that the directory and files have the correct ownership and priviledges. I’m using the same channel tags as Sky currently is, that is Entertainment, Sports, Movies, Documentaries, …

8. If you want to use icons I recommend having a local apache server running with you icon directory. Most of the icons I got from http://www.team-mediaportal.com/extensions/tv-channels/uk-tv-radio-channel-logos. They are located in the directory /var/www/pvr.logos on the same machine that is running TVHeadend and can be accessed as http://192.168.1.3/pvr.logos/ from other machines in my local network.

The script is called htsCreateChannels.py and can be started with various arguments. I recommend that you will use -–no-act argument until you are only getting errors/warnings that you are sure you want to ignore. The script reads in the list I created of channels, read channel tags from tvheadend/channeltags and all the transports from tvheadend/dvbtransports. It creates all the channels in tvheadend/channels and patches the needed transports.
It will use a channel definition file, which is by default assumed to be channels.cvs. This is a cvs formatted file with the following format:

Channel Number, HD Channel Number, Service Name, Channel Name, Channel Tag

HD Channel Number, Channel Name and Channel Tag are optional so if empty HD Channel Number is assumed to be the same has Channel Number and Channel Name is assumed to be the same as Service Name.
Orginally I used the list of sky channels that I found at: http://www.channelwiki.org/wiki/List_of_channels_on_Sky_(UK_&_Ireland). But have been modifying it since.

9. Make sure that there are no channels defined in tvheadend/channels. Then run the script. If you are not using icons just run with the following command:
$ ./htsCreateChannels.py --tvheadend-dir=tvheadend --no-act

Check if you get any warning or errors. If you get any warning like…

warning: "310:Sky DramaRom" was not found in dvbtransports, defined in line 168.

Then check if you can find the service, update channels.cvs and try again. When searching for services I usually find it easiest simple to grep for it, i.e.

$ grep -i drama tvheadend/dvbtransports/*/*

When you have fixed all the warnings just skip the –no-act argument and all the channels will be created. Make sure that the ownership and privileges for tvheadend/channels is correct.

If you are using icons use the following arguments:

$ ./htsCreateChannels.py --tvheadend-dir=tvheadend --icon-dir=/var/www/pvr.logos --http-prefix=http://192.168.1.3/pvr.logos/ --no-act

--icon-dir is the directory where the script should search for the correct icond and -–http-prefix is the prefix that should be added in the icon property of the channel.

I haven’t run the script for a while, so I’m sure it is not up to date. To figure out what the new service name is I usually go to http://tv.sky.com/tv-guide, find the channel and the service name is usually the name that pops up when you move your mouse over the channel icon.

9. Start tvheadend again.

Hope this will be useful. Let me know if you run in to any problems.

Regards,
Indridi

RE: Channel and Tags Config - Added by J. Rios almost 11 years ago

Thank you very much. I will try it.

Regards
JRios

RE: Channel and Tags Config - Added by colin bailey almost 11 years ago

Hi

I am not sure if you are still watching this thread

If so could you help with your script I have downloaded and followed your instructions
Which all seems to run OK and output's 400 channels added but when I review my channels in TVheadend I have nothing

I know there is a few channel's missing causing some errors should this stop the script applying any channel's to TVheadend

Any help welcome

RE: Channel and Tags Config - Added by Indridi Bjornsson almost 11 years ago

Hi Colin,

Even though the scripts reports errors, it should still create all the channels it is able to locate.

Are you sure that the channels where actually created? Did you skip the --no-act argument. The channel files should be located under tvheadend/channels. If you have lot of files there then I would suspect that the privileges are not correct.
If you are running tvheadend as user hts, the owner and group should be hts:hts
If not do a
$ chown -R hts:hts tvheadend
in the .hts directory.

You can also start tvheadend without the -f argument and you might see some warnings/errors that might help you figuring this out.
If you are not successful you can also send me the config and I can take a look at it.

The channels list is rather old. Sky is always changing the channels. I have a never one, but it is not up to date. If you want I can send you a new one later.

Regards,
Indridi

RE: Channel and Tags Config - Added by colin bailey almost 11 years ago

Hi
Thanks for the reply sorry its taken a few days to responed

I have switched to the HTS users and re ran the scripit removing --no-act and it all seems to work

If you ever get chance to update the scripit let me know I have found it very useful

I just have a few picture quality issues to sort out before I can go live on the family

Just a quick question wht do you have 2 refrences to Channel Number “Channel Number, HD Channel Number”

Thanks again

RE: Channel and Tags Config - Added by Indridi Bjornsson almost 11 years ago

Hi Colin,

It's nice to know that someone find this helpful. I'll let you know if I change the script or updates the channel list. The plan was to update the channel list some time ago but I just haven't had the time.

The reason for having both channel number and a HD channel number is because some SD channels are also broadcasted in HD. If you have HD you usually want them only or at least before the SD channels.
If you go to http://tv.sky.com/tv-guide and select London SD you can see that "Sky 1" has the channel number 106 and the same channel in HD "Sky 1 HD" has the channel number 216.
If now change the location to London HD you can see that two channels have been swapped, "Sky 1 HD" is 106 and "Sky 1" is now 216.

If you look at the channels.cvs file you can see that they are defined as:
...
106,216,,Sky1,Entertainment
...
216,106,,Sky1 HD,Entertainment
...

So the first value is the real channel number and the second (if defined, you don't have to) means the channel number of identical channel, but in different format.
By default the script will do a HD swap but you can also use the --disable-HDSwap argument which will not swap the channels. You can also use the --HD-only argument that will only create the HD channel but not the SD channel.

Regards,
Indridi

    (1-9/9)