Help with EPG for noob
Added by Dan Charb over 9 years ago
Hi all - been playing around all long weekend trying to install tvheadend on my openelec machine.
got the backend installed, did the channel scan, mapped the channels and have live tv working on the backend machine and various clients.
problem I am running into is with the EPG data.
I got the xmltv.xml file ok and renamed it to tv_grab_file.xml and placed in under storage but am unsure now as to how to get this working.
one thing I think may need to be done is to rename the channels so they match the xml file.
for example, one the channels listed in tvh is CBLT-DT and here is what I see in the xml file :
<tv source-info-name="Zap2it" generator-info-name="mc2xml" generator-info-url="mailto:[email protected]">
<channel id="I5.28456889.microsoft.com">
<display-name>5 CBLT</display-name>
<display-name>5</display-name>
<display-name>CBLT</display-name>
<display-name>CBLT - CBC Toronto</display-name>
<display-name>CBC Affiliate</display-name>
I have tried renaming the channel to '5 CBLT' and 'I5.28456889.microsoft.com' but doesn't work.
Any help here would be much appreciated.
Replies (6)
RE: Help with EPG for noob - Added by Kris Hammond over 9 years ago
So, this is a little confusing, but the way the grab file works is that it reads a separate xmltv.xml file (that is generated by another program). So you don't want to necessarily rename the xml file or change channel names or anything like that. Or at least, I didn't have to. Here is how I have it set up:
I set up a cron job to run a small custom script that, once a day, runs a separate perl script which I downloaded.
The perl script is called zap2xml.pl and it goes online (zap2it.com) and downloads epg data for my location, based on command line arguments (contained in my custom script). It writes an xmltv.xml file. It doesn't matter where you put this, as long as the path is accessible.
I have a different script called tv_grab_file that I downloaded. This is the file that tvheadend looks for to fetch your epg data. It needs to be put in /usr/bin so tvheadend will find it. You also need to change one line of the script to point to your xmltv.xml file (the line is near the top and begins with "cat." Just enter the path to the xmltv.xml file you generated earlier.
After that, the tv_grab_file should turn up in your tvheadend UI under internal grabbers. You can set it to grab the xml data every day, shortly after the perl script is run. Although you'll want to give it a few minutes breathing space. The perl script takes a while to churn through the listings.
RE: Help with EPG for noob - Added by Paul Meli over 9 years ago
Seems like everyone has a little different problem, so this was hard for me to pin down. Anyway, when it comes to this I'm a noob too.
What worked for me was to assign Channel Names after I figured out which channel was what (TVheadend never mapped my channels, so I had to do it manually, and it was tedious).
Still, TVheadend never seemed to read my xmltv data until I matched my channels in the EPG Grab Source column to channels under the Channels tab. Double-clicking on a blank line in the column on my system brings up a list of channels to choose from to match (apparently) the data downloaded from whatever source you are using (in my case Microsoft)…
…which renamed all of the channels I had previously named to something different (more compatible?). So I went with it…
After that TVheadend read my channel data, but still nothing in the Electronic Program Guide…until I hit the Reset button. Voila!
Instead of running a script when I download new program data, I just change the grab interval from 12 hours to 1, save and change back again to 12, then re-save, then hit the reset button.
Kind of a pain, and anyway I rarely watch TV (I download my shows with Sickbeard) but I was obsessed with getting this to work. Hope this helps someone.
RE: Help with EPG for noob - Added by Dan Charb over 9 years ago
Thanks to both of you that replied ! Looks like I managed to get it working.
Kris - Not sure where I read it but thought you had to change the xmltv file name to tv_grab_file so changed it back and downloaded the real tv_grab_file. One thing though, you mentioned that this file has to be in usr/bin but everytime I tried to put it there I wasn't able to. And read somewhere that this is readable only so just left it in the same folder as the xmltv file.
Paul - went in to the EPG grab source column and choose the channel that matched ! Had no idea that you had to do that so thank you !
Does anyone know how to combine xmltv.xml file ?
I am in an area that gets channels from 2 different regions (2 different countries) so I need to be able to download 2 different files and combine them so that I get EPG for all my channels.
RE: Help with EPG for noob - Added by Kris Hammond over 9 years ago
Ah, yeah... openelec. I ended up using a different distro (osmc) due to the locked filesystem issues. But if you can get tvheadend to see your tv_grab_file under internal grabbers, then no problem. So, one question: are you generating new xmltv.xml files regularly? They have to be continually updated so your schedules stay up-to-date. I generate a new one every day (and overwrite the old one). That is the tricky part, particularly in openelec. If you are using a linux pc (x86), it's not as hard. There are programs you can download to do this. But if you are on a Raspberry Pi like me, your options are more limited.
As for combining xml data, there are some programs that claim to do it. Look at WebGrab++. I looked at it briefly but opted for something more straightforward. If you want to continue using microsoft's wmc listings, look at mc2xml. It's compiled for x86, so you'll need to be running a PC to use it. I'm not sure if it will combine data from multiple sources, but it has a lot of command line arguments available, so it might. Both of those programs are run on a regular schedule (ie, daily) and generate a fresh xmltv.xml file for your grab file to grab.
RE: Help with EPG for noob - Added by Dan Charb over 9 years ago
Kris Hammond wrote:
Ah, yeah... openelec. I ended up using a different distro (osmc) due to the locked filesystem issues. But if you can get tvheadend to see your tv_grab_file under internal grabbers, then no problem. So, one question: are you generating new xmltv.xml files regularly? They have to be continually updated so your schedules stay up-to-date. I generate a new one every day (and overwrite the old one). That is the tricky part, particularly in openelec. If you are using a linux pc (x86), it's not as hard. There are programs you can download to do this. But if you are on a Raspberry Pi like me, your options are more limited.
As for combining xml data, there are some programs that claim to do it. Look at WebGrab++. I looked at it briefly but opted for something more straightforward. If you want to continue using microsoft's wmc listings, look at mc2xml. It's compiled for x86, so you'll need to be running a PC to use it. I'm not sure if it will combine data from multiple sources, but it has a lot of command line arguments available, so it might. Both of those programs are run on a regular schedule (ie, daily) and generate a fresh xmltv.xml file for your grab file to grab.
Thanks but I realized that most of the channels I watch are included in one grab so I don't need to combine xml data after all.
As far as updating the EPG data every day, is there an easy to follow guide on how to set up a cron job ?
I have never done anything like that before and wouldn't know where to start.
I got my initial data from my windows machine so need some help getting this done automatically on my openelec machine.
RE: Help with EPG for noob - Added by Kris Hammond over 9 years ago
Dan Charb wrote:
Thanks but I realized that most of the channels I watch are included in one grab so I don't need to combine xml data after all.
As far as updating the EPG data every day, is there an easy to follow guide on how to set up a cron job ?
I have never done anything like that before and wouldn't know where to start.
I got my initial data from my windows machine so need some help getting this done automatically on my openelec machine.
So, I haven't tried to set up a cron job in openelec. Since it's largely locked down, it might not work. But here's how I did it in OSMC:
crontab -e
this should bring up your cron scheduler so you can edit it. Once it's open, enter the command in cron format like so:
0 4 * * * /media/zap2xml/zap2xml.pl
This tells cron to go to the folder /media/zap2xml and run the zap2xml.pl perl script (which generates my xmltv.xml file) every morning at 4AM.
Once you are done editing the file, you can check it with:
crontab -l
to make sure it looks right. Cron is not really made for running code, it's more for just pointing to a script or file and saying "do that at this time." The script that you point it to is the one that does all the heavy lifting.