edit4ever / script.module.zap2epg

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

Question: Can the script be edited or ported to run on Android/Kodi/Nvidia Shield and TVHeadend installed on QNAP NAS #20

Closed Dawgneck closed 4 years ago

Dawgneck commented 4 years ago

Hello, edit4ever.

I understand your zap2epg script was created for LibreELEC. I overlooked this, installed it on my Android Kodi (Leia, installed on a Nvidia Shield) system and I spent two days trying to get the grabber information to show up in my Tvheadend back-end ( which is installed on a QNAP NAS).

I'm sure the LibreELEC install doesn't install the files into the correct directories on the QNAP but I hope its possible to edit the script to point everything to the correct folders.

The following TVheadend grabber script points everything into the correct folders for "tv_grab_uk_tvguide":

`#!/bin/sh

Check if supplement directory has files

SUPPLEMENT_COUNT=$(/usr/bin/find /share/CACHEDEV1_DATA/.qpkg/xmltv/supplement -type f -print 2> /dev/null | /usr/bin/wc -l) if [ $SUPPLEMENT_COUNT -gt 0 ]; then

xmltv QPKG: load local libraries with supplement

XMLTV_SUPPLEMENT=/share/CACHEDEV1_DATA/.qpkg/xmltv/supplement LD_LIBRARY_PATH=/share/CACHEDEV1_DATA/.qpkg/xmltv/lib /share/CACHEDEV1_DATA/.qpkg/xmltv/bin/tv_grab_uk_tvguide $*

else

xmltv QPKG: load local libraries

LD_LIBRARY_PATH=/share/CACHEDEV1_DATA/.qpkg/xmltv/lib /share/CACHEDEV1_DATA/.qpkg/xmltv/bin/tv_grab_uk_tvguide $*

` I don't know how to create a script but if you think all I need to do is edit your zap2epg script to show the above directories on the QNAP NAS (and add a directory for Python and whatever other directories I need) and all will work, I'd like to give it a try.

Do you think it's possible to edit you script in this fashion to get it to work with the TVheadend back-end installed on the QNAP NAS? Do you think it will take a long time for someone who has never written a script to perform this?

Thanks in advance!

edit4ever commented 4 years ago

try downloading the settings.xml file and putting it in the same folder as zap2epg.py Those are the only 2 files you should need. Edit the settings.xml file to fit your needs (change the zipcode, set the xtra description field to true/false, change number of days/etc) All of those settings can be changed in Kodi - so if you have a Kodi system running the way you want - configure zap2epg and then just copy your settings.xml and the zap2epg.py files to whatever location you want to run it on. Should work.

Dawgneck commented 4 years ago

Thank you, edit4ever.

I will work on it tomorrow!

Dawgneck commented 4 years ago

Hello, edit4ever.

I performed the steps but TVHeadend still does not show an EPG Grabber Module for Zap2EPG.

Is there another step I need to perform?

edit4ever commented 4 years ago

Two options - you either create a cron to run the zap2epg.py file (usually once a night is enough) then use the built in tvheadend xmltv external grabber to point to the generated xmltv.xml file.

Or you need to drop the tv_grab_zap2epg file into your /usr/bin/ folder (or possibly your /home/hts/.xmltv/ folder)

Then restart and it should show up.

Dawgneck commented 4 years ago

Thank you, edit4ever!

I will work on this tonight after work!

On Wed, Jun 3, 2020 at 6:45 AM edit4ever notifications@github.com wrote:

Two options - you either create a cron to run the zap2epg.py file (usually once a night is enough) then use the built in tvheadend xmltv external grabber to point to the generated xmltv.xml file.

Or you need to drop the tv_grab_zap2epg file into your /usr/bin/ folder (or possibly your /home/hts/.xmltv/ folder)

Then restart and it should show up.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/edit4ever/script.module.zap2epg/issues/20#issuecomment-638207089, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFCHL6R4ZC6F54A6STD3A3RUZHWBANCNFSM4NHSWY7Q .

-- Dawgneck

Dawgneck commented 4 years ago

Hello, edit4ever.

I see that TVHeadend installed the other "tv_grab" files in the /usr/bin/ directory, so I'd prefer to use your second, "/usr/bin" suggestion.

When I copied the tv_grab_zap2epg file to the /usr/bin/ folder and restarted TVHeadend, the zap2epg grabber still didn't show up.

The first three lines in the tv_grab_zap2epg file states:

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

The xmltv folder is found in this QNAP NAS directory: /share/CACHEDEV1_DATA/.qpkg/xmltv. The TVheadend folder is found in this qnap nas folder: /share/CACHEDEV1_DATA/.qpkg/tvheadend. Each of the above folders contains a BIN subfolder.

Kodi is found in on my Nvidia Shield.

Since I'm running Kodi from a Nvidia Shield and TVheadend is installed on my qnap nas, would any of the lines in the tv_grab_zap2epg file need to be modified to point to the correct folder(s) in my system? Would any lines in any of the other zap2epg files need to be modified?

By the way, the following is the code in the TV_Grab_na_tvmedia file:

`#!/bin/sh

Check if supplement directory has files

SUPPLEMENT_COUNT=$(/usr/bin/find /share/CACHEDEV1_DATA/.qpkg/xmltv/supplement -type f -print 2> /dev/null | /usr/bin/wc -l) if [ $SUPPLEMENT_COUNT -gt 0 ]; then

xmltv QPKG: load local libraries with supplement

XMLTV_SUPPLEMENT=/share/CACHEDEV1_DATA/.qpkg/xmltv/supplement LD_LIBRARY_PATH=/share/CACHEDEV1_DATA/.qpkg/xmltv/lib /share/CACHEDEV1_DATA/.qpkg/xmltv/bin/tv_grab_na_tvmedia $*

else

xmltv QPKG: load local libraries

LD_LIBRARY_PATH=/share/CACHEDEV1_DATA/.qpkg/xmltv/lib /share/CACHEDEV1_DATA/.qpkg/xmltv/bin/tv_grab_na_tvmedia $*

fi ` Thanks.

edit4ever commented 4 years ago

I believe in your case both ADDON_HOME and ADDON_DIR should be set to the location you placed the zap2epg.py and settings.xml files in. You can set the XMLTV_OUTPUT to any directory you want.

Make sure that both zap2epg.py and the tv_grab_zap2epg are set as executable. Sometimes they don't copy over with that permission. Also...I believe they may need to be executable by the HTS user that tvheadend created. Just something else to check. :-)

Dawgneck commented 4 years ago

Thanks, edit4ever.

I'm researching this further and will let you know how it goes later today or tomorrow.

Thanks again!

Dawgneck commented 4 years ago

edit4ever:

Thank you for your help.

When I edited and executed the file, this is what I got:

Command '"./tv_grab_zap2epg"' failed with return code 0 and error message ./tv_grab_zap2epg: line 27: cd: /share/CACHEDEV1_DATA/.qpkg/xmltv/bin/script.module.zap2epg: No such file or directory python: can't open file '/share/CACHEDEV1_DATA/.qpkg/xmltv/bin/script.module.zap2epg/zap2epg.py': [Errno 2] No such file or directory cat: /share/CACHEDEV1_DATA/.qpkg/xmltv/bin/xmltv.xml: No such file or directory.

While I believe I'm close to resolving this, I don't know enough about Linux to edit the files to make this run properly.... Therefor I will have to toss in the towel at this point. I will monitor this board in case you or anyone else creates a version of zap2epg that works in a scenario like mine (Kodi running on Nvidia Shield and TVHeadend/zap2epg files installed on QNAP NAS).

Thank you sincerely for your help!

edit4ever commented 4 years ago

OK - Try placing zap2epg.py, settings.xml and this version of the grabber: https://drive.google.com/file/d/1qvVyWqn3o_7NeJ8Dkj2BQ6LkczrxMNEI/view?usp=sharing In your /usr/bin/ folder with the other grabbers.

I changed that grabber to just look at the current directory to find the zap2epg.py file - so that should work for you.

Dawgneck commented 4 years ago

Awesome, edit4ever!

A Google request was sent to you to allow me access to the file.

Thanks in advance.

edit4ever commented 4 years ago

Apologies...I had the wrong security setting on the file. You should be able to see it now.

Also - here's a dropbox link in case the other one still isn't working: https://www.dropbox.com/s/o7obljpeumzf6c9/tv_grab_zap2epg?dl=0

Dawgneck commented 4 years ago

Thanks for your help, edit4ever.

Unfortunately, I'm still unable to get it to work with my setup....

I REALLY APPRECIATE your help but I must admit defeat at this time and stick with the plain-Jane OTA Tvheadend grabber.

FYI: When I execute TV_grab_zap2epg from usr/bin, I get the following message: "Command '"./tv_grab_zap2epg"' failed with return code 126 and error message -sh: ./tv_grab_zap2epg: /bin/bash^M: bad interpreter: No such file or directory."

When I execute zap2epg.py from usr/bin, I get the following message:

"Command '"./zap2epg.py"' failed with return code 2 and error message ./zap2epg.py: line 17: import: command not found ./zap2epg.py: line 18: import: command not found ./zap2epg.py: line 19: import: command not found ./zap2epg.py: line 20: import: command not found ./zap2epg.py: line 21: import: command not found ./zap2epg.py: line 22: import: command not found ./zap2epg.py: line 23: import: command not found ./zap2epg.py: line 24: import: command not found ./zap2epg.py: line 25: import: command not found ./zap2epg.py: line 26: import: command not found ./zap2epg.py: line 27: import: command not found ./zap2epg.py: line 28: import: command not found ./zap2epg.py: line 29: import: command not found ./zap2epg.py: line 30: from: command not found ./zap2epg.py: line 31: import: command not found ./zap2epg.py: line 32: from: command not found ./zap2epg.py: line 33: import: command not found ./zap2epg.py: line 36: syntax error near unexpected token (' ./zap2epg.py: line 36:def mainRun(userdata):'."

Again, thank you for all your help.