edit4ever / script.module.zap2epg

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

401 unauthorized #15

Closed bluenote73 closed 4 years ago

bluenote73 commented 4 years ago

I get a 401 unauthorized error when trying to use zap2epg. When I go to a browser and go to the URL listed, I also get 403 forbidden, and no prompt to enter the password. I'm running a docker image from linuxserver on rpi, version 4.3-1804~gebb096804

I'm not sure if this is my configuration error, but I saw someone in your libreelec forum thread had a similar issue last year.

EDIT: I turned off digest authentication, but I still get 403 forbidden even after I enter my credentials trying to go to the /api/status/connections URL. Going to the :9981 main url works fine though.l

thanks for any insight

edit4ever commented 4 years ago

This likely has to do with an issue with the tvheadend installation user. zap2epg is meant to run as a kodi addon - not really as a stand alone script.

A better option for stand alone running is zap2xml: http://zap2xml.awardspace.info/

However, if you want to run this as a stand alone script - you're going to need a settings.xml file configured for your system. You can download this one and then change the lineup code and zip code as needed. As an FYI, it's easier to go ahead and install the addon in a kodi setup and then copy the settings.xml file to the stand alone system you want to run it on.

https://1drv.ms/u/s!AhL4aRs7Xd05ga4RROvL1AKShbCn5g?e=AwXdAi

For additional troubleshooting - what url are inputting that is getting the 401 and 403 errors?

bluenote73 commented 4 years ago

Thanks for the quick response. Actually, I am running this under kodi right now, not standalone (although, I prefer to run standalone and will probably do that later). What I just discovered is changing the tvh authentication to "digest+basic" seems to still throw errors but then works (so I finally got what looks to be a successful run, can view the channel list, and so on, which was previously not possible).

In chrome, I enter the same url that kodi pops up as an error. In chrome that throws a 403 but in kodi it throws 401. (http://user:pass@xxx.xxx.xxx.xxx:9981/api/status/connections

edit4ever commented 4 years ago

I may not have all the user:pass configurations updated with current versions of tvheadend. I don't use them on my system. Glad it looks like it's working. If it is not...let me know and maybe I can take a look at the updated tvh user/pass stuff in the next few days.

bluenote73 commented 4 years ago

So I just realized that the script expects tvh to be running on the same box. So if I throw the zap2epg.py script into my docker container along with settings.xml is there a output command to specify the path of where to dump the xml file? Or alternatively, is there a flag to tell the grabber where to find the file? Or is there a better way to set this up? thanks, sorry to hijack here.

edit4ever commented 4 years ago

If you want to run zap2epg on your server - I assume you are also running tvheadend from there - just would prefer to not run kodi. Technically, the only files needed to run this are zap2epg.py and settings.xml. You can run a cron on your server to trigger the running of zap2epg each day. The xmltv.xml file will be output in the location of the zap2epg.py file. Then you can setup your tvheadend with the built in external xmltv grabber to point to the location of the xmltv.xml file.

This is a way to do it without using the zap2epg grabber - which currently uses the kodi directories. If you wanted to edit the zap2epg grabber - find the tv_grab_zap2epg file on your system (should be in the bin folder) and edit the following lines with your zap2epg.py location:

ADDON_HOME="$HOME/.kodi/userdata/addon_data/script.module.zap2epg" ADDON_DIR="$HOME/.kodi/addons/script.module.zap2epg" XMLTV_OUTPUT="$ADDON_HOME/xmltv.xml"

Then the zap2epg grabber should work for you in tvheadend.

As an FYI - if using the RPi just as a tvheadend server - I actually like using LibreELEC on the system with my tvh2kodi and zap2epg addons. It's a simple setup with an easy to use on screen interface. Then I just disconnect the pi from my monitor and place it away to run on its own. :-)

bluenote73 commented 4 years ago

Hi, sorry to keep bothering you. The internal file grabbers seem to complain about tags they don't like, but the external XMLTV sock importer AFAIK cannot be pointed to a file, it just waits to be sent output. I could maybe append something to the zap2epg.py script to send the file to the xmltv sock, is that the way to go about this or am I missing something? Thanks

edit4ever commented 4 years ago

If you go into the settings for the tvheadend service addon in kodi - you can set the xmltv source to FILE and then point to the location of the xmltv.xml file that is generated by zap2epg.