Jump to content


Photo

[Enigma2] XMLTV Import - XMLTV file format


  • Please log in to reply
16 replies to this topic

#1 nether

  • Member
  • 19 posts

+1
Neutral

Posted 3 January 2014 - 19:27

Hello,
I'm using plugin XMLTV Import in OpenPLI and I have a XMLTV file using different fields.
Here is a sample programme:



<programme start="20140104011500 -0200" stop="20140104080000 -0200" channel="STC" program_id="0000131624" event_id="00000000000031743483" series_key="00000000066305000000">
<title lang="pt">Caderno Regional</title>
<title lang="en">Caderno Regional</title>
<desc>Cultura, informacao e prestacao de servico, com jornalismo din?mico e imparcial. Nosso telejornal ganha a cada dia, o elevado respeito e seriedade junto a populacao de nossa regiao.</desc>
<category lang="pt">Jornalismo</category>
<category lang="pt">Informativo</category>
<country>Brasil</country>
<video>
<colour>yes</colour>
</video>
<rating system="Advisory">
<value>Programa livre para todas as idades</value>
</rating>
</programme>

As you can see, it uses a lot of fields, such:
- category
- video
- colour
- rating



Is there any way to use this XMLTV file?
 
Thanks in advance.



Re: [Enigma2] XMLTV Import - XMLTV file format #2 doglover

  • Rytec EPG Team
  • 17,376 posts

+657
Excellent

Posted 4 January 2014 - 09:52

Not at the moment.

In enigma only three fields are supported.  Title, Subtitle and Description.

 

When I have this information available, I include this info at the end of the description field  (or in the subtitle field)

 

 

  <programme start="20131228151500 +0000" stop="20131228163000 +0000" channel="BBC1.uk">
    <title lang="en">Call the Midwife</title>
    <sub-title lang="en">[Drama]  Call the Midwife: Christmas Special</sub-title>
    <desc lang="en">It's Christmas time in Poplar and love is in the air as Jenny's relationship with Alec continues to blossom, while Shelagh is planning her quiet wedding to Dr Turner. However, the peace is suddenly disturbed when the police arrive at Nonnatus House to announce an unexploded bomb has been discovered just around the corner and everybody in the district is being evacuated to safety. The electricity has been cut off and the streets are pitch-black, and with the locals scurrying to safety, the nuns and nurses reach out to anyone in need of medical help. The spirit of the Blitz takes over as the community's members pull together - aware that, at any moment, their homes could be reduced to rubble. Jessica Raine, Jenny Agutter, Pam Ferris and Laura Main star in a festive special of the 1950s-set drama, with a guest appearance by comedienne Sandi Toksvig.
Thea Sharrock
Jenny Lee (Jessica Raine), Sister Julienne (Jenny Agutter), Sister Evangelina (Pam Ferris), Chummy Noakes (Miranda Hart), Sister Monica Joan (Judy Parfitt), Trixie Franklin (Helen George), Cynthia Miller (Bryony Hannah), Shelagh Turner (Laura Main), PC Peter Noakes (Ben Caplan), Dr Patrick Turner (Stephen McGann), Fred Buckle (Cliff Parisi), Timothy Turner (Max Macmillan), Alec Jesmond (Leo Staar), Yvonne Bridges (Victoria Bewick), Alan Bridges (Sam Swainsbury), Maggie (Lucy Kilpatrick), Capt Goodacre (Raymond Coulthard), Jack Smith (Jake Bailey), Reporter (Oliver Stoney), Maj Fawcett (Simon Armstrong), Linda Buck (Nancy Carroll), Sister Gibbs (Sandi Toksvig), Voice of mature Jenny (Vanessa Redgrave).</desc>
  </programme>
 

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: [Enigma2] XMLTV Import - XMLTV file format #3 nether

  • Member
  • 19 posts

+1
Neutral

Posted 5 January 2014 - 03:48

Thank you for your reply, doglover.
Do you have some script or some simple method for converting it as you mentioned?
Can you share it?

Thanks in advance.

Re: [Enigma2] XMLTV Import - XMLTV file format #4 doglover

  • Rytec EPG Team
  • 17,376 posts

+657
Excellent

Posted 5 January 2014 - 08:59

No I do not have such a script.  I am doing the job within the EPG grabber.

The only "script " i have is something to remove the extra tags.

 

You also need grep.exe from GNUwin32

 

:: output folder
set OUTPUT=C:\Documents and Settings\All Users\Application Data\TVxb\xml\

:: bin path
set WGET=C:\Program Files\TVxb\bin\
set INfile=%OUTPUT%rytecxmltvUKplus.xml
set OUTfile=%OUTPUT%rytecxmltvUKplus

"%WGET%grep.exe" -v -f "C:\Documents and Settings\All Users\Application Data\TVxb\ini\GREPpattern.txt" "%INfile%" > "%OUTPUT%tempfile"
 

 

 

The GREPpattern.txt file contains:

 

 


 

<url>
</url>
 />
<icon>
</icon>
<credits
</credits>
<actor
</actor>
<category
</category>
<presenter
</presenter>
TERMS AND CONDITIONS:
 

he result is written in %OUTPUT%tempfile

 

There is one thing however which might do the job.  Take a look here.

And look at he option:  Optional REX postprocessor that allows re-allocation and merging of xmltv elements

And this can be run on an existing file without actually grabbing EPG data.

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: [Enigma2] XMLTV Import - XMLTV file format #5 nether

  • Member
  • 19 posts

+1
Neutral

Posted 5 January 2014 - 14:51

Thanks for the hints, Willy.
I'll take a look at it.
Best regards.

Re: [Enigma2] XMLTV Import - XMLTV file format #6 nether

  • Member
  • 19 posts

+1
Neutral

Posted 11 July 2016 - 18:33

New images support EPG locking by age.

Can you tell me which field handles the programme age? And what is its format?

Thank you!



Re: [Enigma2] XMLTV Import - XMLTV file format #7 doglover

  • Rytec EPG Team
  • 17,376 posts

+657
Excellent

Posted 12 July 2016 - 07:56

See here:

https://www.xmltvlis.../help/api/xmltv

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: [Enigma2] XMLTV Import - XMLTV file format #8 nether

  • Member
  • 19 posts

+1
Neutral

Posted 12 July 2016 - 13:26

Thank you for your reply @doglover.

As I can see, these are the standards for XMLTV guides, but can Enigma2 read and use all these fields?

Some time ago, only three fields were used: Title, subtile and description.

Today I tried to use some more fields, like CREDITS (which contains, ACTORS, DIRECTORS, etc...) but the default enigma2 EPG didn't show these information. Do we need to use an external EPG plugin for these to work? What am I doing wrong?



Re: [Enigma2] XMLTV Import - XMLTV file format #9 doglover

  • Rytec EPG Team
  • 17,376 posts

+657
Excellent

Posted 12 July 2016 - 14:05

Enigma can only read start/stop time, Title, subtitle and description fields.

 

I am adding the actors and other info into these fields.  Therefore i added the next code at the end of every SiteIni.

 

Willy

*For classical credits - remove the next lines
category.modify {cleanup(removeduplicates)}
category.modify {cleanup}
actor.modify {cleanup}
director.modify {cleanup}
actor.modify {replace|\|\||\|}
description.modify {addend('director' not "" separator=", ")|\n'director'}
description.modify {addend('actor' not "" separator=", ")|\n'actor'}
actor.modify {clear}
director.modify {clear}
subtitle.modify {addstart ('titleoriginal' not "") | ('titleoriginal')}
subtitle.modify {addend ('episode' not "") | ('episode')}
subtitle.modify {addend ('productiondate' not "") | ('productiondate')}
subtitle.modify {addstart ('category' not "") |['category'] }
subtitle.modify {addend ('rating' not "") | ['rating'] }rating.modify {clear}
episode.modify {clear}
category.modify {clear}
productiondate.modify {clear}
titleoriginal.modify {clear}
writer.modify {clear}
producer.modify {clear}
composer.modify {clear}
starrating.modify {clear}
rating.modify {clear}
presenter.modify {clear}
starrating.modify {clear}
videoquality.modify {clear}
videoaspect.modify {clear}index_category.modify {cleanup(removeduplicates)}
index_category.modify {cleanup}
index_description.modify {addend ('index_director' not "" separator=", " )|\n'index_director'}
index_description.modify {addend ('index_actor' not "" separator=", " )|\n'index_actor'}
index_description.modify {addend ('index_presenter' not "" separator=", " )|\n'index_presenter'}
index_subtitle.modify {addstart ('index_titleoriginal' not "") | ('index_titleoriginal')}
index_subtitle.modify {addend ('index_episode' not "") | ('index_episode')}
index_subtitle.modify {addend ('index_productiondate' not "") | ('index_productiondate')}
index_subtitle.modify {addstart ('index_category' not "") |['index_category'] }
index_subtitle.modify {addend ('index_rating' not "") | ['index_rating'] }
index_writer.modify  {clear}
index_rating.modify {clear}
index_productiondate.modify {clear}
index_titleoriginal.modify {clear}
index_actor.modify {clear}
index_director.modify {clear}
index_presenter.modify {clear}
index_episode.modify {clear}
index_category.modify {clear}
index_videoquality.modify {clear}

~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: [Enigma2] XMLTV Import - XMLTV file format #10 nether

  • Member
  • 19 posts

+1
Neutral

Posted 12 July 2016 - 15:03

So enigma2 is still not reading age rating, correct?

In some new images there's an option in MENU -> SYSTEM - > PARENTAL CONTROL to lock programmes based on age:

epg_age.jpg

 

I'm trying to figure out how can this be passed to XMLTV format so enigma2 can lock programmes based on age.

I've already tried the <rating> tag as described in XMLTV standards, but got no result. :(



Re: [Enigma2] XMLTV Import - XMLTV file format #11 doglover

  • Rytec EPG Team
  • 17,376 posts

+657
Excellent

Posted 12 July 2016 - 15:29

So enigma2 is still not reading age rating, correct?

Correct.  Also the Plug-0ins for importing the XMLTV  needs to be adapted too.

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: [Enigma2] XMLTV Import - XMLTV file format #12 nether

  • Member
  • 19 posts

+1
Neutral

Posted 12 July 2016 - 18:23

I see.

Maybe this parental control function based on age only works with EIT EPG.

I'll try to turn on my EIT EPG and see if some rating information appears on it.

 

Thank you for your reply.

Best regards.



Re: [Enigma2] XMLTV Import - XMLTV file format #13 doglover

  • Rytec EPG Team
  • 17,376 posts

+657
Excellent

Posted 12 July 2016 - 19:39

I could include the rating tag (and fill it with data if it is available on the websites)  but it is of no use at the moment since most images do not support it at the moment.

Also the import plug-ins do not import it.

 

This could change if the images and the import plug-ins start supporting it.

 

Willy

 

PS: From which image comes the above screenshot?


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: [Enigma2] XMLTV Import - XMLTV file format #14 nether

  • Member
  • 19 posts

+1
Neutral

Posted 12 July 2016 - 21:05

This specific snapshot is from OpenATV 5.3 on a VU+ DUO2, but I get exactly the same result using openBH 0.4 (on another VU+ DUO2) and OpenPLi 4.0 on a Wetek Play.

So I think this rating by age is a major commit in newest open alliance based images.


Edited by nether, 12 July 2016 - 21:05.


Re: [Enigma2] XMLTV Import - XMLTV file format #15 nether

  • Member
  • 19 posts

+1
Neutral

Posted 15 July 2016 - 15:42

Just for feedback purposes, I've tested with EIT EPG and rating by age is not working.

I cloned the git enigma2 repository and the source code from file lib/python/Components/ParentalControl.py:

def isServicePlayable(self, ref, callback, session=None):
self.session = session
if not config.ParentalControl.servicepinactive.value:
return True
#Check if configuration has already been read or if the significant values have changed.
#If true: read the configuration
if self.storeServicePin != config.ParentalControl.storeservicepin.value:
self.getConfigValues()
service = ref.toCompareString()
info = eServiceCenter.getInstance().info(ref)
age = 0
if service.startswith("1:") and service.rsplit(":", 1)[1].startswith("/"):
refstr = info and info.getInfoString(ref, iServiceInformation.sServiceref)
service = refstr and eServiceReference(refstr).toCompareString()
elif int(config.ParentalControl.age.value):
event = info and info.getEvent(ref)
rating = event and event.getParentalData()
age = rating and rating.getRating()
age = age and age <= 15 and age + 3 or 0
if (age and age >= int(config.ParentalControl.age.value)) or service and self.blacklist.has_key(service):
#Check if the session pin is cached
if self.sessionPinCached:
return True
self.callback = callback
title = 'FROM BOUQUET "userbouquet.' in service and _("this bouquet is protected by a parental control pin") or _("this service is protected by a parental control pin")
if session:
Notifications.RemovePopup("Parental control")
if self.PinDlg:
self.PinDlg.close()
self.PinDlg = session.openWithCallback(boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=self.getPinList(), service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control"), simple=False)
else:
Notifications.AddNotificationParentalControl(boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=self.getPinList(), service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control"))
return False
else:

return True

 

and the function getParentalData from file lib/service/event.cpp:
 
PyObject *eServiceEvent::getParentalData() const
{
        ePyObject ret = PyList_New(m_ratings.size());
        int cnt = 0;
        for (std::list<eParentalData>::const_iterator it(m_ratings.begin()); it != m_ratings.end(); ++it)
        {
                ePyObject tuple = PyTuple_New(2);
                PyTuple_SET_ITEM(tuple, 0, PyString_FromString(it->getCountryCode().c_str()));
                PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(it->getRating()));
                PyList_SET_ITEM(ret, cnt++, tuple);
        }
        return ret;
}
 
From that I assume that XML age rating should be something like:
 
    <rating system="BR">
      <value>14</value>
    </rating>

 
But I'm not a programmer so I don't know if that's correct.
 

Edited by nether, 15 July 2016 - 15:45.


Re: [Enigma2] XMLTV Import - XMLTV file format #16 doglover

  • Rytec EPG Team
  • 17,376 posts

+657
Excellent

Posted 15 July 2016 - 16:28

<rating system="BR">
      <value>14</value>
    </rating>

This is according to the standard. 

I have requested this feature to be activated in: http://forums.openpl...l-based-on-epg/

 

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: [Enigma2] XMLTV Import - XMLTV file format #17 nether

  • Member
  • 19 posts

+1
Neutral

Posted 15 July 2016 - 19:00

Thank you very much @doglover.

I'll follow these two threads.

 

Best regards, my friend!




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users