This is brilliant! Many thanks for all the work. As a rookie user, I got brave last night and installed the script on my NUC w/LibreELEC 7.0.3 on USB2 and after a little configuration on the TVHeadEnd web screen I was overjoyed! I also have a tuner and TVHeadEnd (v.4.0.9) installed on an older Intel motherboard that I use running Ubuntu 16.04LTS Desktop with Samba to serve my library and OTA (antenna TV streams) to other laptops on the network and attempted the script installation there (yes, I understand that the script is for Open/Libre and NOT other Kodi platforms such as this.) Things look fine until I ask for the XMLTV module under TVHeadEnd web page at Configuration>Channel/EPG>EPG Grabber>Module. Available there is 'Disabled' and 32 other XMLTV listings, but 'tv_grab_zap2xml' doesn't show. I understand that I may be asking for the impossible here, but would there possibly be a simple fix so that the module would show and the EPG be available to the laptops? I know that this is asking a lot and is somewhat unrelated to the thread here, but... if you don't ask, the answer is always 'no'. Many thanks again.
tvheadend, ATSC and epg...
-
edit4ever -
June 4, 2016 at 5:36 PM -
Thread is Unresolved
-
-
@pvchandler glad it worked for you!
To get the grabber running on a non-LE system...I think the key is determining where to install the grabber file and making sure it is executable. Do a search on the ubuntu system for the tv_grab_zap2xml file. If it is installed in the appropriate kodi addon folder it is likely just an issue with permissions. Check to see if the file is executable. If not, use the chmod +x command to make the file executable. Then reboot and see if the grabber shows up in tvheadend.
-
@pvchandler glad it worked for you!To get the grabber running on a non-LE system...I think the key is determining where to install the grabber file and making sure it is executable. Do a search on the ubuntu system for the tv_grab_zap2xml file. If it is installed in the appropriate kodi addon folder it is likely just an issue with permissions. Check to see if the file is executable. If not, use the chmod +x command to make the file executable. Then reboot and see if the grabber shows up in tvheadend.
Thanks for the quick reply!
Searching (Nautilus) for hidden files/folders from any given point (CTRL-H) shows...On the known good LibreELEC 7.0.3/USB drive, find: /media/paul/Storage/.kodi/addons/script.module.zap2xml/bin/tv_grab_zap2xml. Looking at permissions here, under 'owner' and 'group' it shows 'root' and the check mark for 'Execute'.
On the Ubuntu 16.04LTS Desktop, find: /home/paul/.kodi/addons/script.module.zap2xml/bin/tv_grab_zap2xml. Location is probably correct, and permissions show Owner as Me, and Group as Paul; all 'Read and write' and I was able to simply click the box for the check mark (Execute: x Allow executing file as a program). I believe that this check box is the same as 'chmod +x'.
TVHeadEnd still not pulling in the new module.
Two guesses here: either file needs to be changed to 'root' (I don't know how to to that) or these 32 other XMLTV listings are interfering (unknown how they got there or how to delete.)
Another offshoot idea I've had (might try tomorrow) is to create a new USB drive for that 'Desktop/server' computer; bootable running LibreElec, and share drives/files from there via its internal Samba, then having the laptops point there for shared files and TV stream. In other words, I'm not demanding that that computer run Ubuntu as it currently is. Thanks again,
Paul. -
You're probably correct on the permissions issue. Tvheadend is pretty particular on that. You could try to search for one of the other (32) grabber files and see what the permission settings are on that.
If you're only using the system as a tv/streaming backend - I think installing LE would serve you well as it is lighter weight than a full ubuntu install. I use my raspberry pi for my tvheadend and video file backend and stream it to many different devices. You can customize the samba share so that you can easily access any files/folders you want.
Of course - the other option is to run the zap2xml addon on a different syste and just tell your ubuntu install to look at that other system for the xmltv.xml file. Lots of options.
-
You're probably correct on the permissions issue. Tvheadend is pretty particular on that. You could try to search for one of the other (32) grabber files and see what the permission settings are on that.If you're only using the system as a tv/streaming backend - I think installing LE would serve you well as it is lighter weight than a full ubuntu install. I use my raspberry pi for my tvheadend and video file backend and stream it to many different devices. You can customize the samba share so that you can easily access any files/folders you want.
Of course - the other option is to run the zap2xml addon on a different syste and just tell your ubuntu install to look at that other system for the xmltv.xml file. Lots of options.
Just a quick update... I ditched the Ubuntu idea (Ubuntu remains on HD,) and created a new LE stick (just a 2G USB2) which lets me 'serve' from that desktop, and still have Ubuntu which I will continue to use for my weekly backups and other functions. With that computer and it's tuner card running LE 8.0.1 I'm even getting used to Estuary! All of my media is now served from this small/light OS, and also serves the TV streams and now the EPG. Of course all of the addresses (links) needed to be updated, as well as cleaning/rebuilding libraries, but certainly worth the effort. I'll use another desktop in the bedroom which will not only deliver all the media, but allows me to have a (mostly) zero cost TV tuner for an old analog-tube TV, and with this one machine it will stream all media. Your script 'completes the package' making LE/Kodi a full media system.
During the summer I enjoy movies/TV while sunbathing, and having my laptop(s) point to this new server function, its now better than ever and I'm thrilled.
My living room media player is an older desktop, and because I fell in love with the Neon skin (sounds like that won't be updated to the newer Kodi versions (but there are lots of skins...)) so I have OE6.0.3 w/Kodi 15.2 and Neon running there on USB. The script hasn't failed on any of these installations, so I'll agree with the others that it's where it needs to be and I (personally) would like to see it published for the users in U.S. Thanks again and congratulations (to all) on some truly impressive software. I'm indebted.... -
Been a while, but thought I'd check in once more just to confirm with you.....
My tvguide.xml file has been updating without any issues. My guess is this is a releasable version (assuming you haven't already done so).
Great work and appreciate the effort.
Thx again and cheers....
UPDATE 3/20/17:Things are working so well, I didn't remember to check for a file update till now. And it's still working fine. I suspect you can call this a solid "Release Candidate".
Thx for your work and effort in this.
Cheers....
3/17/17
Just another quick update.....over a week into it and my tvguide.xml file continues to be updated as scheduled. I don't want to jinx things, but I believe you've worked out the "kinks"Cheers....
-
Hey all, so I haven't heard, has this made its way into the official Kodi repo? If so what's it called? Where is it?
-
I have not added it there yet as there were still some issues that were being worked on when I have time. You can download the latest release from my gitub and install it from the addons settings:
Releases · edit4ever/script.module.zap2xml · GitHub
I'm still looking for feedback and issues - so please post any problems if you try it out! Thanks.
-
Thanks. I didn't realize this is for when the tvh server runs on the kodi box. Mine runs on my synology. Is there a way to get this to work on there?
-
You can use the original work to setup a cron on your Synology. Just take a look here:
Hope that helps!
-
Thanks. Synology has a perl or python module installer, so i could use either.
-
My xmltv.xml was generated but stopped in middle. All channels were printed, but only couple of lines of programs got printed.
I got this error in zap2xml.log
Code
Display MoreWriting XML file: /storage/.kodi/userdata/addon_data/script.module.zap2xml/xmltv.xml Exception error<type 'exceptions.SyntaxError'> Traceback (most recent call last): File "/storage/.kodi/addons/script.module.zap2xml/zap2xml.py", line 2143, in <module> main() File "/storage/.kodi/addons/script.module.zap2xml/zap2xml.py", line 2115, in main printProgrammes(fh) File "/storage/.kodi/addons/script.module.zap2xml/zap2xml.py", line 1385, in printProgrammes xdets = addXDetails(programs[p], schedule[station][s]) File "/storage/.kodi/addons/script.module.zap2xml/zap2xml.py", line 1607, in addXDetails optList = ast.literal_eval(options["-V"]) File "/usr/lib/python2.7/ast.py", line 49, in literal_eval File "/usr/lib/python2.7/ast.py", line 37, in parse File "<unknown>", line 1 [,,,,,,,,,,,,,,,,,,,,] ^ SyntaxError: invalid syntax
-
If this is the first time you are trying to run this - try turning off the xtra details option for now. It seems there is some bad data in there, so let's make sure you can first get a standard grid loaded.
Would also help to know how many days you're trying to download, what lineup your using and how many channels.
-
If this is the first time you are trying to run this - try turning off the xtra details option for now. It seems there is some bad data in there, so let's make sure you can first get a standard grid loaded.Would also help to know how many days you're trying to download, what lineup your using and how many channels.
Yes first time.
Here is channel line up (Chicago OTA broadcast). 7 Days. All (not just faves). Extra details enabled.
Code
Display More<display-name>2.1 WBBMDT</display-name> <display-name>2.2 WBBMDT2</display-name> <display-name>5.1 WMAQDT</display-name> <display-name>5.2 WMAQDT2</display-name> <display-name>5.2</display-name> <display-name>7.1 WLSDT</display-name> <display-name>7.2 WLSDT2</display-name> <display-name>7.3 WLSDT3</display-name> <display-name>9.1 WGNDT</display-name> <display-name>9.2 WGNDT2</display-name> <display-name>9.3 WGNDT3</display-name> <display-name>11.1 WTTWDT</display-name> <display-name>11.2 WTTWDT2</display-name> <display-name>11.3 WTTWDT3</display-name> <display-name>11.4 WTTWDT4</display-name> <display-name>13.1 WOCKCD</display-name> <display-name>13.2 WOCKCD2</display-name> <display-name>13.3 WOCKCD3</display-name> <display-name>13.4 WOCKCD4</display-name> <display-name>13.5 WOCKCD5</display-name> <display-name>20.1 WYCCDT</display-name> <display-name>20.2 WYCCDT2</display-name> <display-name>20.3 WYCCDT3</display-name> <display-name>22.1 WRJKLD</display-name> <display-name>22.2 WRJKLD2</display-name> <display-name>22.3 WRJKLD3</display-name> <display-name>22.4 WRJKLD4</display-name> <display-name>22.5 WRJKLD5</display-name> <display-name>22.6 WRJKLD6</display-name> <display-name>22.7 WRJKLD7</display-name> <display-name>23 WWMECA</display-name> <display-name>23.1 WWMELD</display-name> <display-name>23.2 WWMELD2</display-name> <display-name>23.3 WWMELD3</display-name> <display-name>24.1 WPVNCD</display-name> <display-name>24.2 WPVNCD2</display-name> <display-name>24.3 WPVNCD3</display-name> <display-name>24.4 WPVNCD4</display-name> <display-name>24.5 WPVNCD5</display-name> <display-name>24.6 WPVNCD6</display-name> <display-name>24.7 WPVNCD7</display-name> <display-name>26.1 WCIUDT</display-name> <display-name>26.2 WCIUDT2</display-name> <display-name>26.3 WCIUDT3</display-name> <display-name>26.4 WCIUDT4</display-name> <display-name>26.5 WCIUDT5</display-name> <display-name>32.1 WFLDDT</display-name> <display-name>38.1 WCPXDT</display-name> <display-name>38.2 WCPXDT2</display-name> <display-name>38.3 WCPXDT3</display-name> <display-name>38.4 WCPXDT4</display-name> <display-name>38.5 WCPXDT5</display-name> <display-name>38.6 WCPXDT6</display-name> <display-name>40.1 WESVLD</display-name> <display-name>44.1 WSNSDT</display-name> <display-name>44.2 WSNSDT2</display-name> <display-name>48 WMEULP</display-name> <display-name>48.1 WMEUCD</display-name> <display-name>48.2 WMEUCD2</display-name> <display-name>48.3 WMEUCD3</display-name> <display-name>48.4 WMEUCD4</display-name> <display-name>50.1 WPWRDT</display-name> <display-name>50.2 WPWRDT2</display-name> <display-name>50.3 WPWRDT3</display-name> <display-name>50.4 WPWRDT4</display-name> <display-name>57.1 WDCILD</display-name> <display-name>60.1 WXFTDT</display-name> <display-name>60.2 WXFTDT2</display-name> <display-name>60.3 WXFTDT3</display-name> <display-name>61.1 WCHULD</display-name> <display-name>61.2 WCHULD2</display-name> <display-name>61.3 WCHULD3</display-name> <display-name>61.4 WCHULD4</display-name> <display-name>62.1 WJYSDT</display-name> <display-name>62.2 WJYSDT2</display-name> <display-name>62.3 WJYSDT3</display-name> <display-name>62.4 WJYSDT4</display-name> <display-name>66.1 WGBODT</display-name> <display-name>66.2 WGBODT2</display-name> <display-name>66.3 WGBODT3</display-name>
I will enable faves only, also reduce number of days (currently 7) to 5 and disable extra details and try.
[hr]
Here are two more observations.
- xmltv.xml got populated overnight (probably on second run). This was with: all channels (faves only disabled), 7 days, with extra details.
- I then enabled 'faves only', set to 5 days, disabled extra details. The xmltv.xml got updated successfully.So the zap2it add on is working now. Probably it was bad data which threw python off track.
I then uninstalled the tvheadend4.2 (service) and deleted the userdata for tvheadend42. Re configured the tvheadend (service) 4.2. This time I disabled all OTA grabbers and kept zap2it enabled. The EPG grid in TV->Guide is empty even though xmltv.xml is populated. I am probably missing some setting. I will read rest of the posts here to find, but if you have quick tip help.
Awesome add-on by the way, in xmltv.xml, i can see the guide data, lot of good data pulled in by addon.
Thanks and appreciate your effort. -
I read your thread from beginning and found the solution. I went to Configuration->EPG/Channels. I found that that EPG Source options were empty initially. After couple of reboots (or perhaps just waiting 10-15 min), I saw EPG Source options were populated. I set a few channels to Zap2it. But the TV->Guide was still empty. After annother couple of boots (or waiting a few minutes, not sure which) the TV-Guide got populated.
Awesome, Awesome. I have now enabled extra details, also increased days to 7. No issues till now, I can see details in TV->Guide. I have still kept "faves only" enabled and I have about 30 channels as favorite on Zap2it site (so pulling data of 30 channels instead of 80+).
Thanks
-
Glad to hear it's working! The epg in kodi sometimes needs a reboot in order to update after a manual grab of the guide in tvheadend - but it looks like you've discovered that.
As an FYI - the grabber will run again everytime you reboot (usualy within a few minutes) - you can also change the times that it runs automatically in tvheadend. By default it runs twice a day at 00:04 and 12:04 - which is more than enough to keep stable updates running. I usually recommend that folks slightly adjust those numbers so we all don't hit the server at the same time! You do that in the tvheadend web interface under the CONFIGURATION > CHANNEL/EPG > EPG GRABBER tab in the multi-cron area that contains this:
For reference - the digits are as follows:
Code# * * * * * command to execute # ┬ ┬ ┬ ┬ ┬ # │ │ │ │ │ # │ │ │ │ │ # │ │ │ │ └───── day of week (0 - 6 or Sunday - Saturday) # │ │ │ └────────── month (1 - 12) # │ │ └─────────────── day of month (1 - 31) # │ └──────────────────── hour (0 - 23) # └───────────────────────── min (0 - 59)
Just change the hour and/or minute in the cron multi-line to adjust and then hit save. (note the hour is currently set to twice a day by using */12 - star means any match - more details here: EPG Grabber - Tvheadend 4.0)
I'm just started working on a kodi addon to setup and configure tvheadend without having to use the web interface. This will make it a lot easier for people - but I'm having to figure out all the tvh apis as there isn't any documentation. Hoping to have something for folks to test in the next few weeks.
-
Thank you Edit for the explanation of the grabber settings, I never really understood it, now I do.
-
Fixed it (finally), I think!!! But not quite sure why (more familiar with Fedora than with Debian). Here's how I got (back) here:1. tvguide.xml not being written to with guide info - I tend to believe this was the heart of the problem....but was thinking it was a path issue. May have been, but not in the way I thought (or understood Frustratingly curious by this point, I deleted tvguide.xml and then ran tv_grab_zap2xml. Results were tvguide.xml not found. Never saw this error before so apparently tvguide.xml was being found, but not necessarily the one (or in the way) I believed it was. Created a new tvguide.xml, ran tv_grab_zap2xml again and "File not found" error went away again...still no info written to the file, tho.
2. Import mechanize error - For this I went back to look (yet, again) at zap2xml.py. When this problem started and I was thinking pathing issue, I changed the kodiPath variable to an absolute reference (/home/osmc/....) and deleted the /storage directory reference because that doesn't exist on my system. Still, running tv_grab_zap2xml produced the "import mechanize" error. Decided it was time to start fresh. I extracted a clean copy of zap2xml.py from the .zip file. Again made the changes to kodiPath. This time, tho, I used Notepad++ set for the python language to edit and save. Restarted tvheadend and watched the HDHomeRun tuner LEDs flash.
I have Samba enabled on my RPI 3/OSMC so I could check file properties from my Win 10 system. Since I knew tvguide.xml was new and was 0 bytes, I had a reference point. Giving tvheadend a bit of time to do its stuff, I checked properties of tvguide.xml. Lo, and behold, it showed ~2MB and a very recent modified date/time. Went downstairs and checked Live TV/Guide and everything was back (Yayyyy!). I changed days to 14 and checked it again this morning (update set for 3AM) and the program guide had info out to 12/30/16.
The only thing I can think of is the recent system update glitched something to do with accessing *my* tvguide.xml file. Apparently the guide data was getting written somewhere (no obvious error notices), just not into my file. The "import mechanize" error is on me and just complicated things (I got other odd errors along the way from executing this program). I had been editing the zap2xml.py file with a different editor and that may have introduced some odd control/invisible chars causing problems for Python. Using Notepad++ in Python mode seemed to work just fine.
When I get the chance I'll go sniff around the Debian/OSMC logs and see if there are any error outputs that might relate to this problem.
So, thanks for the assistance...at least, until the next time
Just a heads up... if you're running OSMC, then you could have just installed pearl, then the regular zap2xml and needed files. I believe edit4ever's version is specifically for LibreELEC/OenELEC, where you can't install pearl.
-