Simple solution? Not obvious to me

Added by greg kimnach 4 months ago

I have been using zap2it for tv listings for over a year without a problem. Last night my EPG was empty, and it seems to me it is because TVlistings is now logged into with a pop-up window. (I really do not remember it being that way when I set up my account in November of 2016.) I have been using the zap2xml.pl script.

A result of searching, I tried the xml-util package (https://github.com/rocky4546/script.xmltv.tvheadend/wiki/Guide:-How-to-Setup-XMLTV-for-TVHeadEnd), and running the script results in:

Testing zap2it login
ERROR: Login failed, recieved message
000<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>Found</h1> <p>The document has moved <a href="https://tvschedule.zap2it.com/tvlistings/ZCLogin.do">here</a>.</p> </body></html> 302

Note the https and the /ZCLogin.do which are at odds with the original perl script.

I did try modding the script to no avail.

What to do with this script?

thanks,
greg


Replies (7)

RE: Simple solution? Not obvious to me - Added by K Shea 4 months ago

You are not imagining things, Zap2it changed the look and feel of their site a few days ago.

What you need to do is go download the revised zap2xml.pl script from http://zap2xml.hosterbox.net/ or http://zap2xml.mooo.com/ and also read the new release notes from this year. I would suggest using the new -8 option to avoid getting duplicate listings, IF (and only if) you have set up favorite channels (or "starred" channels as they are called on Zap2it's site).

The bad part is that in all likelihood all your channels will have different channel ID's than they did before. So this means you will have to import the xml file into Tvheadend, then go to Configuration|Channel/EPG|Channels and reset the EPG source for each of your channels to the new channel ID's, then import the XML file again so that the new guide data is imported.

This has been a PITA for everyone that has been using Zap2it for guide data, but hopefully this gives you enough info to get it working again.

RE: Simple solution? Not obvious to me - Added by Russell Hall 3 months ago

@K Shea - Thank you for the information about the Zap2it site and the revised Perl script!

russell

RE: Simple solution? Not obvious to me - Added by Lance Gilbert 3 months ago

Hi folks,

I noticed the missing guide data today, after after some troubleshooting and log investigation, decided to check for an updated zap2xml.pl script. Now, with the new script, I can successfully grab EPG data, but now my importing via unix socket xmltv.sock is not working ...

The command that has been working (run via a daily cron job) is:

/bin/cat /home/osmc/scripts/xmltv.xml | /usr/bin/socat - UNIX-CONNECT:/home/osmc/.hts/tvheadend/epggrab/xmltv.sock

Any ideas why the import using socat is now failing?

RE: Simple solution? Not obvious to me - Added by K Shea 3 months ago

I've never done it that way. I've always used tv-grab-file (from https://github.com/Rigolo/tv-grab-file) instead. This article explains how to use it: https://freetoairamerica.wordpress.com/2014/12/03/some-hints-for-getting-free-to-air-satellite-channels-into-the-electronic-program-guide-in-kodi-or-xbmc-or-another-frontend/

But having said that, if I had to guess, it's likely a Linux permissions or ownership issue (assuming that /home/osmc/scripts/xmltv.xml actually contains the xml file produced by the zap2xml.pl script). Let me guess, you deleted the old xmltv.xml file and then copied the new "good" one there, but maybe now it is not world readable? Remember that Tvheadend runs as its own user (usually as user hts unless you have changed it) so if you create a file as another user or as root and it's not world readable, Tvheadend won't see it. Once a file is created, if you copy a new file over it the permissions of the previous file are kept.

This is just a wild guess and I may be way off, but that's the first thing I'd check.

RE: Simple solution? Not obvious to me - Added by Lance Gilbert 3 months ago

Thanks for the reply. Your suggestions are indeed very relevant. I had already double checked and verified all permissions and ownership info for associated files, scripts, and services -- especially considering the zap2xml upgrade and the recent OSMC upgrade to Debian 9.3.

What I discovered, eventually, is that the recent change to zap2xml 2018-01-09 version, channel id's, is the issue -- as it is not backwards compatible. After I passed the -9 option (added as part of the 2018-01-10 version), my guide data was imported/visible.

I had suspected it was a channel id incompatibility issue, and spent time investigating potential issues with cache folder and the tvheadend epgdb.v2 file. After giving the zap2xml version log a REALLY good read, I realized the source of my troubles ... ;)

So, to be concise, I believe the guide data was there all along, just not displayed, since the channels need to be edited to map to the current channel id format ... socat was not failing. This mirrors your comments in your first post/original reply to OP. (Again, if I'd paid more attention, I would have saved myself some time ... !)

When I can set aside the time, I suppose I will drop the -9 option and disable channel EPG mappings, import the current standard version of the channel id's, then remap the channels ...

RE: Simple solution? Not obvious to me - Added by K Shea 3 months ago

You're welcome!

Lance Gilbert wrote:

When I can set aside the time, I suppose I will drop the -9 option and disable channel EPG mappings, import the current standard version of the channel id's, then remap the channels ...

Actually, you may not want to do that, because if you don't use that option it includes the channel number in the channel ID, which is not an issue until a tv station changes its channel number or moves a subchannel to a different point number (such as 10.3 to 10.4, if you are using OTA listings). Or, if you are using a cable or satellite provider for listings and they decide to move channels around, again things will stop working if you aren't using -9. The downside to using -9 is that if you are not also using favorites (starred channels) and the -8 option, you can get duplicate channel entries in your XML file (this is due to the way Zap2it creates its page data). I do use favorites, and I do not want to have to deal with channel number changes, so I use both the new -8 and -9 options introduced in the 2018-01-10 version.

Unfortunately favorites don't seem to "stick" for TV Guide if you use one of the default time zone lineups, and don't actually enter a zip or postal code and select a lineup, but there are few reasons to want to use a default time zone listing.

RE: Simple solution? Not obvious to me - Added by Lance Gilbert 3 months ago

Hmm, well - I don't use favorites, and if using the -9 option will continue to be supported, then I see no reason to change my config, thanks. (I only considered changing the config due the "not recommended" statement in the version log ...)

(1-7/7)