My XML not working - please help
Added by Joe Bloggs almost 4 years ago
Hi,
I've got TVH installed via libreelec/kodi.
But I'm migrating it to a standalone ubuntu server.
Not of that is relevant but ...
I've got two custom IPTV channels which are streams from my CCTV via ffmpeg to display as channels on all the TV's.
but now I want to add simple EPG data because they look bare.
I also have a IP radio station which I will do the same for once I figure out the static channels.
I have doen research on using the unix socket and appear to have this working but I think my XML file is wrong some how as the channel info have imported and is listed against both channels in TVH web interface, but the EPG data does not list nor show on the TV via kodi unlike all other channels.
I'm importing with:
cat /storage/.kodi/userdata/cctv.xml | curl -d @- -m 5 -X POST --unix-socket /storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltv.sock http://google.com
The following XML file:
<?xml version="1.0" encoding="UTF-8"?>
<tv generator-info-name="Daves XML">
<channel id="905">
<display-name>Overview</display-name>
<programme channel="905" start="20201127170000 +0000" stop="20201127180000 +0000">
<title lang="en">Overview Cam</title>
<desc lang="en">Live: Overview of the street.</desc>
<date>2020</date>
<category lang="en">CCTV</category>
<episode-num system="onscreen">1</episode-num>
</programme>
</channel>
<channel id="901">
<display-name>Front Door</display-name>
<programme channel="901" start="20201127000000 +0000" stop="20301127000000 +0000">
<title lang="en">Front door Cam</title>
<desc lang="en">Live: Overview of the drive.</desc>
</programme>
</channel>
</tv>
TVH log shows:
2020-11-27 16:58:41.719 [ INFO] xmltv: xmltv: channels tot= 2 new= 0 mod= 0 2020-11-27 16:58:41.719 [ INFO] xmltv: xmltv: brands tot= 0 new= 0 mod= 0 2020-11-27 16:58:41.719 [ INFO] xmltv: xmltv: seasons tot= 0 new= 0 mod= 0 2020-11-27 16:58:41.719 [ INFO] xmltv: xmltv: episodes tot= 0 new= 0 mod= 0 2020-11-27 16:58:41.719 [ INFO] xmltv: xmltv: broadcasts tot= 0 new= 0 mod= 0
Which reading other threads says it's partly working, but it's not recognising the "episode" data.
In TVH GUI the channels EPG source is configured:
CONFIGURATION > CHANNEL/EPG > CHANNELS
Front Door: 901 (XMLTV)
Overview: 905 (XMLTV)
And the "EPG Grabber Channels" tab looks filled out too.
Both of these happened automagically, so I got something right
But nothing in the EPG and I've run my script again.
Ideally I want one episode which runs for the next 10 years continuously.
If not, and say I must have 24hr max episodes then I'll write a script to do that accordingly.
I just want to import this once for both channels and call it a day.
Please help if you can, point out where my XML syntax is wrong - I'm sure this is the problem but I cant see the wood for the trees!!
Replies (3)
RE: My XML not working - please help - Added by Joe Bloggs almost 4 years ago
I've had a look back at this again and I cannot see the issue.
If I'm doing something fundamentally stupid please tell me.
It surely cannot be this complicated ?!?
RE: My XML not working - please help - Added by Hiro Protagonist almost 4 years ago
The XML files I'm using are formatted like:
<channel id="112"> <display-name lang="en">Channel Name</display-name> </channel> <channel id="113"> <display-name lang="en">Next Channel Name</display-name> </channel> <programme start="20201201140000 +1300" stop="20201201150000 +1300" channel="112"> <title lang="en">Programme Name</title> <category lang="en">News</category> <category lang="en">Current Affairs</category> </programme>
Maybe start with the bare minimum in the XML & add more stuff once you have that working.
Make sure that when you send to TVH the times are in the future in your timezone.
Why do you have "http://google.com" in the curl parameters?
RE: My XML not working - please help - Added by Joe Bloggs almost 4 years ago
Thanks for the reply.
TBH I wasn't sure what the bare minimum was/is.
I couldn't find a good guide which talked about creating your own, it mostly seems posts on the internet are about manipulating EPG data into the correct format, and the XML is already done.
I'll try the future data but I didn't think this was important as when you import EPG a programme could have already started, certainly OTA data shows this.
curl command copied from this post:
https://tvheadend.org/boards/12/topics/32084?r=32186#message-32186
(The http://google.com website is just a placeholder, since it doesn't ever actually get contacted. However, curl needs to try to connect to something. You might be able to replace google.com with localhost or 127.0.0.1; in the end it doesn't matter, because all communication is outgoing through the socket.)
I just changed it to suit my paths after trying socat and nc in order and not finding them on libreelec install.
Anyway, it's working now with this:
<channel id="901">
<display-name lang="en">Front Door</display-name>
</channel>
<channel id="905">
<display-name lang="en">Overview</display-name>
</channel>
<programme channel="901" start="20201203100000 +0000" stop="20251203140000 +0000">
<title lang="en">Front door Cam</title>
<desc lang="en">Live: Overview of the drive from the front door.</desc>
<category lang="en">Current Affairs</category>
</programme>
<programme channel="905" start="20201203100000 +0000" stop="20251203140000 +0000">
<title lang="en">Overview Cam</title>
<desc lang="en">Live: Overview of the street from front left of house.</desc>
<category lang="en">Current Affairs</category>
</programme>
That's two hours in the past at time of writing and 5years into the future.
Must be down to some syntax in the XML you shared. Thanks for that !!
What also helped was exporting the current EPG data from a OTA channel to get an idea of the format:
<tv generator-info-name="TVHeadend-4.2.8-36 ~ LibreELEC Tvh-addon v9.2.0.123" source-info-name="tvh-Tvheadend">
<channel id="0aa2ced0584697404f61c35333bd6774">
<display-name>BBC ONE HD</display-name>
<display-name>1</display-name>
<icon src="http://192.168.1.10:9981/imagecache/140"/>
</channel>
<programme start="20201203100000 +0000" stop="20201203110000 +0000" channel="0aa2ced0584697404f61c35333bd6774">
<title lang="eng">Homes Under the Hammer</title>
<sub-title lang="eng">
18/30. Featuring an ambitious project to create a dream home in Crewe, a former stables in Derby and a studio flat in London's Paddington. Also in HD. [S]
</sub-title>
<desc lang="eng">
18/30. Featuring an ambitious project to create a dream home in Crewe, a former stables in Derby and a studio flat in London's Paddington. [S] [HD]
</desc>
</programme>
Display name doubles up with channel number. I tried that but on the "EPG Channel Grabber" page it still doesn't populate the number column :)
Description is duplicated as sub-title which seems to more correct when you look at the EPG page in the TVH web interface, so I'll likely duplicate that later.
I'll probably change the EPG data for CCTV to include weather or a motd - just because..