content type/category

Added by Kevin Devane over 11 years ago

i'm using

XMLTV module version 0.5.59
This is tv_grab_uk_rt version 1.331, 2010/11/19 11:31:00

to get epg guide information.
All show names & information is imported, but content type is blank. Only content type that appears is 'Music'

Is there something else I need to do ?

Replies (12)

RE: content type/category - Added by Stéphane Bidoul over 11 years ago

Hi Kevin,

The xmltv category is recognized by tvheadend only if it matches
the following strings coming from the DVB standard:

"Movie / Drama" 
"News / Current affairs"
"Show / Games"
"Children's / Youth"
"Art / Culture"
"Social / Political issues / Economics"
"Education / Science / Factual topics"
"Leisure hobbies"
"Special characteristics"

else it is ignored.

I've an experimental patch that adds a category field to the epg.
It's on github ( if you want to test it.

Best regards,


RE: content type/category - Added by Kevin Devane over 11 years ago

Hi Stéphane,

Thanks for the reply, that explains why i'm not getting the genre info from radio times..

Will take a look at building form github source, i;m a bit of a newbie, so need to do some reading before i give it ago.


RE: content type/category - Added by neil mac over 11 years ago

What does that solve sbi? I have hacked in a fix for UK/IE radiotime xmltv users.

Its a change to epg.c and its and complete hack, I considered raising a bug/feature that meant you could configure the values that it matches on. Is it normal for xmltv feeds to not follow the dvb standard.

epg_content_group_find_by_name(const char *name) {
if (!strcmp(name,"Drama") || !strcmp(name,"Film") || !strcmp(name,"Movie") || !strcmp(name,"Comedy drama") || !strcmp(name,"Sitcom") || !strcmp(name,"Comedy")){
return 1;
else if (!strcmp(name,"News") || !strcmp(name,"Current affairs") || !strcmp(name,"News and current affairs")){
return 2;
else if (!strcmp(name,"Game show") || !strcmp(name,"Talk show") ){
return 3;
else if (!strcmp(name,"Sport")){
return 4;
else if (!strcmp(name,"Children") || !strcmp(name,"Animation")){
return 5;
else if (!strcmp(name,"Music") || !strcmp(name,"Music and Arts") ){
return 6;
else if (!strcmp(name,"Arts and culture")){
return 7;
else if (!strcmp(name,"Discussion/Debate") || !strcmp(name,"Reality") || !strcmp(name,"Soap") ){
return 8;
else if (!strcmp(name,"Education") || !strcmp(name,"Sci-fi") || !strcmp(name,"Drama documentary") || !strcmp(name,"Documentary") || !strcmp(name,"Factual") || !strcmp(name,"Science") || !strcmp(name,"Religion") ){
return 9;
else if (!strcmp(name,"Gardening") || !strcmp(name,"Transport") || !strcmp(name,"Cookery") || !strcmp(name,"Nature") || !strcmp(name,"Health") || !strcmp(name,"Home and property") || !strcmp(name,"Travel") || !strcmp(name,"Consumer") || !strcmp(name,"Motoring") || !strcmp(name,"Food") ){
return 10;
else if (!strcmp(name,"Special characteristics") || !strcmp(name,"Interests")){
return 11;
return 0;

RE: content type/category - Added by Joshua Welch almost 11 years ago

I committed this in a fork, and so hopefully it gets in the official. It fixes my problems too. (dirty fix, but still better than nothing.)

RE: content type/category - Added by Joshua Welch almost 11 years ago

Made patch that seems to work with ScheduleDirect for me. I changed the above code to be a bit cleaner and such.

Repo Here:

git clone [email protected]:oneadvent/tvheadend.git

RE: content type/category - Added by neil mac almost 11 years ago

Works great for me too. I am using Radio Times XMLTV feed

RE: content type/category - Added by Yura Scheglyuk almost 11 years ago

Hardcoding of EPG categories is not good practice. In other languages this EPG categories may be written by other words. The best way of category recognizing is made it configurable. May be in web frontend or in config files.

For example Russian EPG contains this categories:

<category lang="ru">Сериал</category>
<category lang="ru">Мультфильм</category>
<category lang="ru">Художественный фильм</category>

RE: content type/category - Added by Joshua Welch almost 11 years ago

Yes sir, this is my next undertaking. My plan:
  1. Make another tab to allow for changing.
  2. Start with the categories we use now (the 11), and allow user imputed, comma separated values for each category. With this a "default" button.
  3. After that is working: Allow changing the categories.

Just to be clear though, it will probably take me 100 years to do this, but it IS what I want to work on with it. I was also going to look into running the category recognizer at the beginning instead of the end of the tv_grab_na_dd and then again at the end. That way categories are immediately available instead of after parsing that xml. I'm sure there is a reason it isn't, I just haven't looked into it yet.

:) Anyone wanting to contribute lemme know.

RE: content type/category - Added by Pluto P about 10 years ago

i up this thread, because i'm new with tvheadend and i got the same problem with italian categories, using tv_grab_it.
All epg programs has the genre "Drama" (using xbmc as client).

I ask if after some months there are news about it, or if it is plan in the TODO list...?
or....are categories better using opentv?

this is an example of the xmltv code i get :

<programme start="20121123141000 +0100" stop="20121123151500 +0100" channel="">
    <title lang="it">Verdetto Finale</title>
    <desc lang="it">Casi ispirati alla cronaca o controversie verosimili vengono ricostruiti in studio e sottoposti all'attenzione del giudice.</desc>
    <category lang="it">show</category>
    <category lang="it">intrattenimento</category>

thank you.

RE: content type/category - Added by Adam Sutton about 10 years ago

Currently the XMLTV parser only works with a fixed set of genre strings (which are English). I had plans to make this configurable but I simply never got around to finishing the work. It's still on my TODO list though and I'm pretty sure there is an FR in somewhere for it.


RE: content type/category - Added by c0m m0n over 8 years ago

Any update on this ?

RE: content type/category - Added by c0m m0n over 8 years ago

I tried this and it worked for France / Kazer :

Could easily be adapted to any country. That's a dirty method, but you don't change anything in tvh and that seems stable.

The unmatched output helps you check what needs mapping.