edit4ever / script.module.zap2epg

zap2epg - EPG grabber for USA/Canada
GNU General Public License v3.0
41 stars 25 forks source link

Trying to get the script to work #16

Closed robman501a closed 4 years ago

robman501a commented 4 years ago

I can't seem to get this script to work with the original code. It's looking in the 'hts' folder for my Kodi installation but it should be pointing to the 'pi' folder.

2019-11-15 19:26:00.000 xmltv: /usr/bin/tv_grab_zap2epg: grab /usr/bin/tv_grab_zap2epg
2019-11-15 19:26:00.004 spawn: Executing "/usr/bin/tv_grab_zap2epg"
2019-11-15 19:26:00.044 spawn: /usr/bin/tv_grab_zap2epg: line 27: cd: /home/hts/.kodi/userdata/addon_data/script.module.zap2epg: No such file or directory
2019-11-15 19:26:00.118 spawn: python: can't open file '/home/hts/.kodi/addons/script.module.zap2epg/zap2epg.py': [Errno 2] No such file or directory
2019-11-15 19:26:00.125 xmltv: /usr/bin/tv_grab_zap2epg: no output detected
2019-11-15 19:26:00.125 xmltv: /usr/bin/tv_grab_zap2epg: grab returned no data
2019-11-15 19:26:00.126 spawn: cat: /home/hts/.kodi/userdata/addon_data/script.module.zap2epg/xmltv.xml: No such file or directory

I did manage to get it to sort of work by changing these following lines. I replaced $HOME with /home/pi.

ADDON_HOME="/home/pi/.kodi/userdata/addon_data/script.module.zap2epg"
ADDON_DIR="/home/pi/.kodi/addons/script.module.zap2epg"

What does the following errors mean? It it saying it can't write the log?

2019-11-15 19:35:53.182 spawn: Executing "/usr/bin/tv_grab_zap2epg"
2019-11-15 19:35:53.465 spawn: Traceback (most recent call last):
2019-11-15 19:35:53.465 spawn:   File "/home/pi/.kodi/addons/script.module.zap2epg/zap2epg.py", line 803, in 
2019-11-15 19:35:53.465 spawn:     logging.basicConfig(filename=log, filemode='w', format='%(asctime)s %(message)s', datefmt='%Y/%m/%d %H:%M:%S', level=logging.DEBUG)
2019-11-15 19:35:53.465 spawn:   File "/usr/lib/python2.7/logging/__init__.py", line 1554, in basicConfig
2019-11-15 19:35:53.466 spawn:     hdlr = FileHandler(filename, mode)
2019-11-15 19:35:53.466 spawn:   File "/usr/lib/python2.7/logging/__init__.py", line 920, in __init__
2019-11-15 19:35:53.467 spawn:     StreamHandler.__init__(self, self._open())
2019-11-15 19:35:53.467 spawn:   File "/usr/lib/python2.7/logging/__init__.py", line 950, in _open
2019-11-15 19:35:53.467 spawn:     stream = open(self.baseFilename, self.mode)
2019-11-15 19:35:53.468 spawn: IOError: [Errno 13] Permission denied: '/home/pi/.kodi/userdata/addon_data/script.module.zap2epg/zap2epg.log'
2019-11-15 19:35:53.551 xmltv: /usr/bin/tv_grab_zap2epg: grab took 0 seconds
2019-11-15 19:35:53.881 xmltv: /usr/bin/tv_grab_zap2epg: parse took 0 seconds
2019-11-15 19:35:53.881 xmltv: /usr/bin/tv_grab_zap2epg:  channels   tot=   35 new=    0 mod=    0
2019-11-15 19:35:53.881 xmltv: /usr/bin/tv_grab_zap2epg:  brands     tot=    0 new=    0 mod=    0
2019-11-15 19:35:53.881 xmltv: /usr/bin/tv_grab_zap2epg:  seasons    tot=  825 new=  825 mod=  825
2019-11-15 19:35:53.881 xmltv: /usr/bin/tv_grab_zap2epg:  episodes   tot=  854 new=  586 mod=  587
2019-11-15 19:35:53.881 xmltv: /usr/bin/tv_grab_zap2epg:  broadcasts tot=  854 new=    0 mod=    0

Also, how does this script update the EPG by itself? Yes, the module has been enabled in TVHeandend. Is there a fix rather than copying my .kodi tree to the hts folder? I prefer not to do that all the time.

edit4ever commented 4 years ago

This add-on is designed to work with standard installations since tvheadend creates and uses the hts user. Since tvheadend launches the script as a built in epg grabber - that's why it is setup that way. Your seeing errors due to the permissions issue with the nonstandard location of your installation.

You may want to look at the original zap2xml script for your setup.

robman501a commented 4 years ago

I tried the zap2xml script but that project isn't working due to a change they done on the zap2it server. Instead of using Kodi on Raspbian, would you recommend that I just use OSMC?

edit4ever commented 4 years ago

I personally recommend LibreELEC - https://libreelec.tv/

They have a very active developer community and the systems run very well. However, the system is more closed than others - for example, your not going to use the system to install other linux stuff - it's really meant to be a super easy and fast Kodi installation.

If that's what your main use is - I'd go that route - at least have fun by giving it a try! But OSMC may work as well for your needs.

Also - did you look at this version of zap2xml? http://zap2xml.awardspace.info/

robman501a commented 4 years ago

Yeah, I think that was the zap2xml I was trying to get going the other day. I think I might go for a dual boot and use Raspbian for general use and ... the other for TVHeadend + HDHomeRun and Kodi. What's the difference between LibreELEC and OSMC anyway? The goal is to get my Pi acting as a DVR so I can record shows and movies that are airing when I am not around my TV.

wbeard52 commented 4 years ago

OSMC is a more feature rich OS. LibreElec is locked down to just running Kodi. It is missing a lot of the basic OS commands. I found LibreElec to limiting for my taste as I wanted to install other software to make my setup more personalized. I have been using OSMC with zap2epg for a long time and it works great. Many thanks to edit4ever and OSMC for that. I did write up a tutorial on how to get zap2epg working with OSMC as my small contribution to both projects.

https://discourse.osmc.tv/t/how-to-populate-epg-data-with-zap2epg/76457

robman501a commented 4 years ago

Thanks. I agree. OSMC seems a lot better and LibreElec seems more limited. I've tried OSMC and was quite happy with the interface and the system. I might dual boot it with Raspbian so I'll have access to the terminal and desktop since OSMC can't give me that. This way I can still use my other programs with the Pi. Now time to choose a boot manager.

edit4ever commented 4 years ago

Sounds like your on your way to a nice personalized setup. Good luck!

I'm going to close this issue - but if you find any problems running zap2epg - please let me know.

robman501a commented 4 years ago

Hi, quick question. Can this script be used without Kodi?

edit4ever commented 4 years ago

Technically yes - but it requires a bit of messing around. You need to manually recreate the settings.xml file and optionally create the TVHChannels.json and channels.json files to filter the amount of channel data downloading.

For guide data without kodi - and just for TVheadend - I would use this software: http://zap2xml.awardspace.info/

edit4ever commented 4 years ago

You can use this file as a reference - place it in the same folder as the zap2epg.py file you are running. Change the zipcode to your location.

https://www.dropbox.com/s/u04y5xosb5f8mgf/settings.xml?dl=0

robman501a commented 4 years ago

I can't seem to get this script to work with the original code. It's looking in the 'hts' folder for my Kodi installation but it should be pointing to the 'pi' folder.


2019-11-15 19:26:00.000 xmltv: /usr/bin/tv_grab_zap2epg: grab /usr/bin/tv_grab_zap2epg
2019-11-15 19:26:00.004 spawn: Executing "/usr/bin/tv_grab_zap2epg"
2019-11-15 19:26:00.044 spawn: /usr/bin/tv_grab_zap2epg: line 27: cd: /home/hts/.kodi/userdata/addon_data/script.module.zap2epg: No such file or directory
2019-11-15 19:26:00.118 spawn: python: can't open file '/home/hts/.kodi/addons/script.module.zap2epg/zap2epg.py': [Errno 2] No such file or directory
2019-11-15 19:26:00.125 xmltv: /usr/bin/tv_grab_zap2epg: no output detected
2019-11-15 19:26:00.125 xmltv: /usr/bin/tv_grab_zap2epg: grab returned no data
2019-11-15 19:26:00.126 spawn: cat: /home/hts/.kodi/userdata/addon_data/script.module.zap2epg/xmltv.xml: No such file or directory

I'm having this issue all over again. It's looking for a folder that doesn't exist and I don't know how to install Kodi as the 'hts' user.