Kodi Community Forum

Full Version: Zap2xml for ATSC in OpenELEC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have OpenELEC running perfectly on my Asus ChromeBox, with Tvheadend happily displaying live TV using an HDHomeRun ATSC tuner (I live in the USA).

I'm now trying to configure the EPG using zap2xml. I know I could use xmltv and Schedules Direct, but I'd like to use zap2it if possible. Problem is: there's no zap2xml addon, and the zap2xml script is a perl script (and as far as I can tell, no perl in OpenELEC)

Is there a way to easily run zap2xml on a sinlge box running also Tvheadend (backend and client), or do I need to install perl first? And, if so, any pointer for a lightweight perl that runs well on OpenELEC

Needless to say, I'm still pretty lost when it comes to Linux setups...

I could find no existing thread on the topic (most run zap2xml on a Linux box and the OpenELEC box has a cron job to pull the file from the Linux machine. But I really want to have a self-contained box).
(2016-04-01, 19:58)robca Wrote: [ -> ]I have OpenELEC running perfectly on my Asus ChromeBox, with Tvheadend happily displaying live TV using an HDHomeRun ATSC tuner (I live in the USA).

I'm now trying to configure the EPG using zap2xml. I know I could use xmltv and Schedules Direct, but I'd like to use zap2it if possible. Problem is: there's no zap2xml addon, and the zap2xml script is a perl script (and as far as I can tell, no perl in OpenELEC)

Is there a way to easily run zap2xml on a sinlge box running also Tvheadend (backend and client), or do I need to install perl first? And, if so, any pointer for a lightweight perl that runs well on OpenELEC

Needless to say, I'm still pretty lost when it comes to Linux setups...

I could find no existing thread on the topic (most run zap2xml on a Linux box and the OpenELEC box has a cron job to pull the file from the Linux machine. But I really want to have a self-contained box).

There's a thread where someone installed ActivePerl to the user directory, then symlinked it or something.. as perl normally needs to be installed in the root directory, but that's locked down in openelec. If you have another pc, you can run zap2xml on it, then copy the *xml file to openelec when the old one expires.. 2 weeks or whatever you set it up for. This is why I chose to install Ubuntu on my Pi, then build kodi on top of that. Even with Raspbian.. you have more control over the system. I have zap2xml running on the same system as kodi, even using the web browser in the os to configure the backend.
(2016-04-12, 00:42)greenbag Wrote: [ -> ]There's a thread where someone installed ActivePerl to the user directory, then symlinked it or something.. as perl normally needs to be installed in the root directory, but that's locked down in openelec. If you have another pc, you can run zap2xml on it, then copy the *xml file to openelec when the old one expires.. 2 weeks or whatever you set it up for. This is why I chose to install Ubuntu on my Pi, then build kodi on top of that. Even with Raspbian.. you have more control over the system. I have zap2xml running on the same system as kodi, even using the web browser in the os to configure the backend.

Thanks for the pointer. After a bit of fiddling, I finally managed to make everything work, capturing the info here for anyone else who needs to do it.

You can download and install ActivePerl on OpenElec (once you know how, rather siple, actually), then add all the necessary Perl packages and finally downloading/running zap2xml

Code:
mkdir -p /storage/downloads/activeperl
cd /storage/downloads/activeperl

# if necessarym replace the download with the latest version
wget http://downloads.activestate.com/ActivePerl/releases/5.22.1.2201/ActivePerl-5.22.1.2201-x86_64-linux-glibc-2.15-299574.tar.gz

tar xzf ActivePerl-5.22.1.2201-x86_64-linux-glibc-2.15-299574.tar.gz

cd ActivePerl-5.22.1.2201-x86_64-linux-glibc-2.15-299574/

./install.sh --prefix /storage/ActivePerl --license-accepted --no-install-html

# done installing perl

#add ActivePerl to PATH
PATH=$PATH:/storage/ActivePerl/site/bin:/storage/ActivePerl/bin

# install some extra perl packages (not sure if all are actually needed, but this works... you can try to run the script and see what dependencies are missing)
/storage/ActivePerl/bin/ppm install TermReadKey
/storage/ActivePerl/bin/ppm install Date-Manip
/storage/ActivePerl/bin/ppm install XML-LibXML
/storage/ActivePerl/bin/ppm install XML-Writer
/storage/ActivePerl/bin/ppm install XML-Twig
/storage/ActivePerl/bin/ppm install File-Slurp
/storage/ActivePerl/bin/ppm install TimeDate
/storage/ActivePerl/bin/ppm install DateTime-Format-Strptime
/storage/ActivePerl/bin/ppm install XML-SAX
/storage/ActivePerl/bin/ppm install XML-NamespaceSupport
/storage/ActivePerl/bin/ppm install IO-stringy
/storage/ActivePerl/bin/ppm install HTTP-Cache-Transparent

/storage/ActivePerl/bin/ppm install JSON-XS

# I decided to store the resulting xmltv.xml file in /storage/xmltv directory, you can use anything else
mkdir -p /storage/xmltv
cd /storage/xmltv
# the current version of the download link for zap2xml for me was at http://zap2xml.hosterbox.net/?h=c61rsa you can find it here: http://zap2xml.awardspace.info/#dependencies)
wget http://zap2xml.hosterbox.net/?h=c61rsa -O zap2xml.pl

Assuming you have a zap2it account, after this, you would usually run a cron job to periodically refresh xlmtv.xml. Here's how you can test it works:

Code:
perl /storage/xmltv/zap2xml.pl -u username@email -p your_password -o /storage/xmltv/xmltv.xml

Since it was the first time I was setting an EPG in tvheadend, I first had to select the xmltv.xml file location in the tvheadend addon UI (from Kodi), then use the tvheadend Web UI to select the right xmltv.xml setting (Configuration, Channel/EPG, EPG grabber, select Internal grabber and there should be your file... it took me a couple of reboots for everything to work). Then Configuration, Channel/EPG, Channels, and one by one map the EPG grabber to the right channel (use Edit, if everything works, you should see a list of your channels in the EPG Source drop down)

Now I just need to make sure that my cron job runs when expected Smile
Holy crap... you got it going? Triple thumbs up!!! Smile
just found this python based version of zap2xml but haven't tried it yet: https://github.com/FastEddyCurrent/zap2xml
(2016-04-27, 19:20)brohawk Wrote: [ -> ]just found this python based version of zap2xml but haven't tried it yet: https://github.com/FastEddyCurrent/zap2xml

I've built on FastEddy's python script and Atrilchuk's sd2xml project to compile a zap2xml Kodi addon to make it easier to install. I'm still working on it - but I think it is far enough along for some folks to try it. This was originally designed for OpenELEC/LibreELEC, so I'm not sure which other installations it will work on. This can also get data from TV Guide instead of Zap2It, just select TV Guide in the configure options.

Just realized that the build includes a reference to a banned repo...will remove and update to exclude the reference! I'll repost as soon as it's ready.
Here is the updated link to the source files:

https://github.com/edit4ever/zap2xml

And for those who want to test without compiling - the addon is linked here - attachments are not working for me:

https://www.dropbox.com/s/wfzbccrolc2iop...1.zip?dl=0

This was designed and tested on LE/OE installs, so please share your results if you test on other platforms. If Tvheadend gives an error when you select the tv_grab_zap2xml epg grabber - please provide the output of the zap2xml.log file. Thanks!
(2016-06-04, 22:49)edit4ever Wrote: [ -> ]Here is the updated link to the source files:

https://github.com/edit4ever/zap2xml

And for those who want to test without compiling - the addon is linked here - attachments are not working for me:

https://www.dropbox.com/s/wfzbccrolc2iop...1.zip?dl=0

This was designed and tested on LE/OE installs, so please share your results if you test on other platforms. If Tvheadend gives an error when you select the tv_grab_zap2xml epg grabber - please provide the output of the zap2xml.log file. Thanks!

I installed your addon on my OpenELEC running tvheadend server, but when I execute you addon it says "This is a console-only addon". What does that mean?

Thanks
You can configure the options in Kodi - but the program runs under Tvheadend as an xmltv grabber. You don't actually run the program in Kodi.

In Tvheadend, under the internal grabbers you should be able to select the zap2xml grabber. If you don't see it after installing, you may need to reboot first.

Of course, you also have to have your zap2it or tvguide account setup - but they're free to setup.
(2016-06-09, 00:52)edit4ever Wrote: [ -> ]You can configure the options in Kodi - but the program runs under Tvheadend as an xmltv grabber. You don't actually run the program in Kodi.

In Tvheadend, under the internal grabbers you should be able to select the zap2xml grabber. If you don't see it after installing, you may need to reboot first.

Of course, you also have to have your zap2it or tvguide account setup - but they're free to setup.

Thank you, got it setup with the configuration screen. Testing it now, will keep you updated.
Edit4ever, this is a follow-up of my observations of your awesome work. You app is really a game changer, it makes it so easy, even a dummy like me can make it work. I have been using my $30 MK808B Plus as my tvheadend server for two or three years now, and it works great for that purpose. It was about a 95% stand alone device, but I needed to run a batch file daily on my Windows computer to create the XMLTV files and then export the file into a folder on my MK808B Plus, for it to pick up the guide data. Now, with your apk, my tvheadend server is 100% stand alone. As it is now, it just sits on my network doing its job as a DVR backend.

If you don't mind, I would like to make a "how-to" video for dummies like me. I am really excited about what you have done.
Thanks a ton.
Glad it worked for you! Thanks definitely goes out to the work of FastEddyCurrent and Astrilchuk whose base files are the core of the work here. Feel free to make the video! I still have some additional work to do to finish the addon, including getting the license files in proper place. Also, there might be some errors using the TV Guide source that I'm still testing.

I'm also considering adding the option for downloading the extended program data, which is an option in zap2xml. The concern is when enabled this adds an additional http request for every program in the guide. It should add more information on the programs into the guide, but I'm not sure what it means for download times or web traffic.

Once complete I will likely submit to OpenELEC and LibreELEC too see if they can add it to the repo. Thanks for testing!!
Looking forward to any improvements you make, but is working great for me as it is.

Thanks again to you, FastEddyCurrent and Astrilchuk.
Updated the addon to fix using TVguide favorites and include program icons when available (right now only on tvguide).

source files updated on github...or download here:

https://www.dropbox.com/s/9msks6bruquhmv...2.zip?dl=0

Thanks!
I was just getting ready to make a how to video, now I will use your update for the video.

thanks.

Update, just added a how-to video for dummies like me, showing how to install and configure your awesome app.

https://www.youtube.com/watch?v=1cWDeAOT...e=youtu.be