EPG for NA OTA/zap2it
Added by Edward Crosby over 7 years ago
So, I am running into an issue where parts of getting EPG to work is flaky when trying to pull from zap2it. I've been using this guide:
https://github.com/rocky4546/script.xmltv.tvheadend/wiki/Guide:-How-to-Setup-XMLTV-for-TVHeadEnd
Here are the issues I am running into:
1. When putting the tv_grab_file in /usr/bin (confirming it is executable and root has ownership), it doesn't appear instantly when I go into Configuration>Channel/EPG>EPG Grabber Modules in the TVHeadend console. This is even after server reboots.
2. Because issue 1 is inconsistent, when I finally get it to appear and it does pull down the EPG, the schedule only appears for a few days and then nothing is seen in the EPG tab.
The tv_grab_file seems to be from an old project. It hasn't been updated in 2 yrs. Could this be a problem?
Is there a better, more consistent method for pulling EPG from zap2it for North America OTA?
By the way, I made some changes to the steps in the wiki guide I referenced above.
In step 4 I ran this command instead since it originally cried:
./zap2xml.pl -u myzap2itusername -p myzap2itpassword -D -S 3
Also, in the tv_grab_file I changed this entry to point to my .xml file:
if (( $# < 1 )) then # cat ~/.xmltv/tv_grab_file.xmltv cat /home/ed/xmltv/xmltv.xml exit 0 fi
Any thoughts, tips, and assistance would be greatly appreciated.
Replies (121)
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
While I didn't structure my github as a standalone - I did build the zap2epg.py file to run that way.
What is missing is a way to create/edit the settings.xml file from a terminal. That can easily be done...and I might be able to get to it in the next week or two. But in the meantime you can look at and use the attached example.
Put this file in the same location as the zap2epg.py file.- Just change "zipcode" to your zip.
- Change "days" to the number of days of data you want to download (up to 14).
- Change "xdetails" to true if you want it to download original air date, cast and other info. -- note this will add extra time to downloads, and if you have a large number of channels/days it can take quite awhile for first time downloads.
- Change "xdesc" to false if you don't want the extra details data added to the plot description.
If you want to run a quick test with 1 day and no extra details set - let me know if it works and I can explain the other settings.
settings.xml (1.44 KB) settings.xml | sample settings file | ||
zap2epg.py (39.6 KB) zap2epg.py | zap2epg program |
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
Thanks, I will try to play around with it later.
One thing i sense with the new Zap2it, is that favorites might only be pulled from one channel lineup, rather than ability to do multiple line-ups using the prior preferences setup. I can log into Zap2it using my existing account, and prior favs are saved, but only per lineup, not all combined.
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
When i run zap2epg.py on a RasPi I am getting a connection refused. Not sure if passwd and usern need to be filled in
RE: EPG for NA OTA/zap2it - Added by K Shea almost 7 years ago
Logins only work if you use tvschedule.zap2it.com.
RE: EPG for NA OTA/zap2it - Added by K Shea almost 7 years ago
edit4ever ! wrote:
While I didn't structure my github as a standalone - I did build the zap2epg.py file to run that way.
What is missing is a way to create/edit the settings.xml file from a terminal. That can easily be done...and I might be able to get to it in the next week or two. But in the meantime you can look at and use the attached example.
Put this file in the same location as the zap2epg.py file.
- Just change "zipcode" to your zip.
- Change "days" to the number of days of data you want to download (up to 14).
- Change "xdetails" to true if you want it to download original air date, cast and other info. -- note this will add extra time to downloads, and if you have a large number of channels/days it can take quite awhile for first time downloads.
- Change "xdesc" to false if you don't want the extra details data added to the plot description.
If you want to run a quick test with 1 day and no extra details set - let me know if it works and I can explain the other settings.
Thanks, but is there a way to login using your login info so you get your favorites? As I noted above, right now it seems you have to use tvschedule.zap2it.com in order for logins to work. Failing that, is there a way to select the generic time zone listings (rather than off-the-air channels) for one of the supported time zones?
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
Sorry - there is a setting in the settings.xml file that needs to be changed...
Please change "tvhmatch" to false or make sure that the "tvhurl" and "tvhport" match the ip address and port of your tvheadend server. That setting is meant to match the channels to the epg source - but it needs to be able to reach the tvheadend server to work.
Also - for an initial download, I recommend setting "xdetails" to false. If it generates an xmltv.xml file - then you can go back and turn that feature on.
Perhaps I can work out a way to have zap2epg handle multiple lineups - but I'll have to investigate.
Logins will not be relevant in zap2epg - the username/password are for tvheadend server access. In order to limit the channels that are downlaoded - you have to have a list of the channel ids entered in the settings.xml - this is a function that is currently handled through the kodi interface...it may be difficult to setup in a terminal function. I can investigate having the system use a zap2it username to get a favorites list.
Finally - the settings.xml file currently is set for OTA broadcast lineups based on the zipcode you put in. If you want it to get generic timezone lineups - change the "lineupcode" setting from lineupId to one of the following:
- DFLTE for Eastern
- DFLTC for Central
- DFLTM for Mountain
- DFLTP for Pacific
You can change the "lineup" setting to whatever name you want - or leave it alone.
If you need a different lineup (cable/satellite) I will need to explain how to get that info from the inspection panel of the website - until I get to building a terminal based settings config function.
Hope this helps get you all going!!
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
If you do want to add a specific list of stations to limit downloads...you will need to do the following for now.
In the settings.xml file you will find a setting labeled "slist". You will be adding a list of station ID numbers here. As an example, here is my list:
20377,40462,29024,30697,49377,101904,21213,45740,24028,69874,50770
To get your list of channel/station IDs - run the zap2epg.py program once. It is recommended to just download 1 day and leave "xdetails" set to false. This will generate the xmltv.xml file.
If you open the xmltv.xml file, you will see a list of stations similar to this:
<tv source-info-url="http://tvschedule.zap2it.com/" source-info-name="zap2it.com">
<channel id="20377.zap2epg">
<display-name>10.1 KGTVDT</display-name>
<display-name>KGTVDT</display-name>
<display-name>10.1</display-name>
<icon src="http://zap2it.tmsimg.com/h3/NowShowing/20377/s28708_h3_aa.png" />
</channel>
<channel id="64727.zap2epg">
<display-name>10.15 KGTVDT15</display-name>
<display-name>KGTVDT15</display-name>
<display-name>10.15</display-name>
<icon src="http://zap2it.tmsimg.com/h3/NowShowing/64727/s10003_h3_aa.png" />
</channel>
...
The list is not in any particular order, but you just need to find the channels you want and note the number in the channel id line. For example, channel 10.1 from above has the channel id 20377. This is the number that you will add to the "slist" setting.
Add all the channel id numbers you want to have downloaded, separating each with a comma. That whole list should be entered in the "slist" setting line in the settings.xml file.
I'm sorry for this workaround - it wasn't my original intention to run zap2epg as a standalone program...but it certainly can be reworked to run that way.
Let me know if there are questions, and I will see what I can do to rework the program to be stand alone friendly. Or someone can fork my repo and build it out as desired.
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
Ok, thanks. I was able to pull down a lineup based on zip code, OTA. So we know it works. Would just need to do some customization to put in working form.
I did a test grab_file, and it pulled in all the channels fine, but it did not pull in episode etc data. Not sure why that would be the case from a .xml file - that information is in the file.
Thanks for your work. Will have to play around more.
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
If you mean that tvheadend saw the channels after running the tvgrab, but didn't load episode data...just check the channels epg source. you will likely have to reset those to the new zap2epg source then rerun the grabber.
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
Ok, yes that was it. Did not know source had to be on a channel prior to grabbing it. That works. Thanks
This may be for the tinkering, but does this have an option to pull in the category/Genre for kodi, so that it will color code the grid? Maybe that is the extra details?
Also, how would one pull digital cable lineup, as i have a cablecard? Thanks
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
It does have the option for genre/category...in fact it has three options.
Option 1 is a simple list of genres/colors. This attempts to make the colored grid a bit easier to understand and simplifies the sub genres into their top level category.
Option 2 is a full list of genres. It attempts to map as many of the sub-categories as possible to the list that tvheadend supports. The grid will be very colorful - but the colors may not mean much to you. :-)
Option 3 is an original list. Nothing is modified - just the original genres are passed to tvheadend. This was created to support a new function in tvheadend to remap genres to categories and pass those to kodi. In this scenario, you need to be running a build of tvheadend newer than mid December. Then on the epg grabber tab, turn on the option to scrape metadata and turn on the option to map genre to category. Then tvheadend will pass the actual genre names to kodi and not color the grid.
To set one of these options, change the "epgenre" setting in settings.xml to 1, 2 or 3. And then rerun the grabber.
Hope that works for you!
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
For those that need to add a cable/satellite lineup. This is currently a bit tricky as you will need to get the code from a browser inspect panel - as I haven't built a lineup selector that work from a terminal. Of course, you could install the zap2epg addon on kodi and set things up and then copy the settings.xml file to any other system you want to use.
However - for those who want to try it for now...go to the zap2it listings website and select your zipcode/lineup. Once it loads, open the browser inspect panel. (right click on the browser window and it should be listed).
Then change to the network view in the inspect panel. Scroll through the items in the list on the left and look for a line that starts with grid?lineup= ... it should be near the top. When you click on that item on the right side of the inspect panel (or bottom depending on how you have your inspect panel setup) you will see a Request URL that looks something like this:
You want to copy the lineupId - in the example above it is USA-CA04486-DEFAULT
grab what is between the lineupId= and the &
This is what you want to put in the settings.xml in the "lineupcode" setting.
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
Ok, thanks for all of this.
I did find the lineupID, but i put that into the line below, and it does not download any data/channels/eps - it does without it, but assume that is the default OTA.
It is like this -- is that right. and below i have the zip. I must be messing something up.
- <setting id="lineupcode">USA-CT06435-DEFAULT</setting>
Best
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
make sure you have the xdetails set to false. You can check the zap2epg log file and post it here I can take a look and see whwere it failed.
If you have a lot of channels in a cable lineup and it is set to 14 days - it can take awhile for the first download. So you may just want to set it to 1 day until you make your channels list.
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
Will run it from Kodi to get the settings file, seems the easiest. Thank you
Update--ok, got channel line-up to work fine, select channels etc. The one thing i cant get to show in the TVH EPG data, is the "Content Type" if you look at the Electronic Program Guide" in TVH web page. It was coming in with the ZAP2XML script, with manipulation by other scripts (it looks like there was a category-filter.pl in the perl setup). I have tried all 3 of the epgenre settings, and have most recent version of TVH 4.3~909. I do see the "categories" in the zap2epg data if i click on a show in the TVH EPG, but it does not fill on the "content type" which I guess gets passed on to Kodi. Since it is not going right into Kodi maybe that is why TVH does not pick it up? Thank you.
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
jim dods wrote:
have most recent version of TVH 4.3~909. I do see the "categories" in the zap2epg data
in the tvheadend webui under the epg grabber tab, click on the zap2epg grabber and be sure to turn on the checkmarks for Scrape credits and extra information: and Use category instead of genre:
Then if you have the epgenre setting to 3 (original) you will get all the categories and the guide won't be colored. If you want a colored guide, select either epgenre 1 or 2 and then turn off the Use category instead of genre option in the tvheadend webui.
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
ok, maybe that is the issue. I do not have a zap2epg grabber, i am only using a basic tv_grab_file. Can i download that somewhere? Yes, I do want color EPG, so i assume that comes from filling in the content type on the webui EPG?
UPDATE - ok, using value 2, and turning it off worked (there are a few gaps, but that must be the data). Thank you!
RE: EPG for NA OTA/zap2it - Added by * drac2000 * almost 7 years ago
First let me tell you edit4ever ! a huge THANKs for this good addon.
Now that zap2xml is not an option anymore
Before I land on this thread, I was doing exactly what you suggested here. I should have looked at it before
edit4ever ! wrote:
You want to copy the lineupId - in the example above it is USA-CA04486-DEFAULT
grab what is between the lineupId= and the &
This is what you want to put in the settings.xml in the "lineupcode" setting.
But I have an issue : xmltv is empty cause i'm not able to get a valid lineupid. I live in Montreal, and when I debugged the api link I have this result:
https://tvlistings.zap2it.com/api/grid?lineupId=CAN-lineupId-DEFAULT×pan=1&headendId=lineupId&country=CAN&device=-&postalCode=J4Y0C4&isOverride=true&time=1515373200&pref=-&userId=-&aid=gapzap
So the lineupid for me is CAN-lineupId-DEFAULT which doesn't look like a valid id for zap2epg and doeasn't produce any info.
If I try with a default from the Addon UI that is little close to what I need in my area:
<setting id="lineup" value="TIMEZONE - Eastern" />
<setting id="lineupcode" value="DFLTEC" />
then everything is fine
Any help please
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
If you are using an over the air (broadcast) lineup...leave the lineupcode as "lineupId"
Just change the zipcode setting.
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
Sorry to be so obsessed with the Category and coloring of the EPG. I do notice the "1" fills in the most data. But I do notice that a lot of shows are filled in with "variety show" -- that would include things like Entertainment Tonight (proper) but even things like sitcoms, dramas etc, ie NCIS, Big Bang Theory etc. These used to be coded comedy, or detective, or drama, etc.
Based on your description above, i probably want "2" for epgenre, but when i use that it does not fill in the data for these prime time type shows - it comes in blank. Perhaps I am missing a setting? Thank you (again).
When i do use '3' and look at the xmltv output file, i do see all the proper categories in there, perfect. but for some reason, only a few of them get picked up by TVH.
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
The issue is that tvheadend was built around the DVB-European standard and which has limited and very different version of genres/categories than are used in the US. To get around this, tvheadend has recently implemented the "scrape credits and extra information" and "use category instead of genre" functions on their epg grabber settings.
"scrape credits and extra information" will find the categories in the xmltv file and add them into tvhedend. This does not replace the tvheadend genres (the dvb-euro standard list) but adds a new list of icons in the tvheadend webui epg that shows the categories.
The only way to get those categories into kodi is to trcik kodi into thinking there is no genre information. Then it will read the list of categories that tveadend has scraped. This is what the "use category instead of genre" function does.
If you have both of those options enabled in tvheadend and you have zap2epg set to 3 - you should have all the categories listed in the kodi epg genre field. You will not have a epg colors as those are specifically tied to the original dvb-euro genres and do not get transferred when the "use category instead of genre" function is enabled.
The reason you see "variety show" so much is the dvb-euro standard does not have the types of listings that cover the kinds of tv shows we have in the US. Things like sitcom, comedy and drama don't exist for tv shows. Comedy and drama are subcategories of Movies. That why the system doesn't really work for US tv listings.
Until Kodi moves to a new universal system that is not tied to the old dvb standard - we are limited in how the genre/category data can be displayed. The best we can do for now is option 3 - full descriptive categories but no colors on the guide. Of course, if you like colors more than descriptions - go with 1 or 2.
Hope that helps clarify the state of the epg issues.
RE: EPG for NA OTA/zap2it - Added by * drac2000 * almost 7 years ago
edit4ever ! ! wrote:
If you are using an over the air (broadcast) lineup...
Yes
...leave the lineupcode as "lineupId"
You are the man @edit4ever. That works.
Your addon does a wonderfull job, it fixes an old issue I had whith encoding for french char in EPG on zap2xml. Plus epg info details are full supported.
I still have small tiny issue since EPG data are not covering all of my channels I have on my TVH, but still it gets me 90% of them.
Thanks a lot man
RE: EPG for NA OTA/zap2it - Added by jim dods almost 7 years ago
Thank you edit4ever. with 2 or 3 and xdetails=true, the proper category is in the xmltv.xml. But thanks for explaining the issue in how TVH handles the items. This will still work great.
RE: EPG for NA OTA/zap2it - Added by edit4ever ! almost 7 years ago
drac2000 - if you want to provide me your zipcode, a list of channels that are missing, your xmltv.xml file and your zap2epg.log - I can take a look and see if I can find the issue. ( if you can, a screenshot of your channels page from the tvh webui would be good as well)
Thanks!
RE: EPG for NA OTA/zap2it - Added by * drac2000 * almost 7 years ago
edit4ever ! wrote:
drac2000 - if you want to provide me your zipcode, a list of channels that are missing, your xmltv.xml file and your zap2epg.log - I can take a look and see if I can find the issue. ( if you can, a screenshot of your channels page from the tvh webui would be good as well)
Thanks!
Thanks are for you edit4ever.
Actually I was about to update my post above. In fact, I am lucky enough to catch few more channels than what tvlistings shows up for my zipcode. I used another postal code to pull those channels and that did it for me.
Thanks edit4ever