edit4ever / script.module.zap2epg

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

TVH 4.3 tv_grab_zap2epg ImportError: No module named request #48

Closed Phaelkyn closed 2 years ago

Phaelkyn commented 2 years ago

In setting up zap2epg in Ubuntu 18.04, there may need to be some additional setup steps noted. I've noticed that there is at least one file that need to be copied

Once there, the tv_grab_zap2epg is referencing the .kodi directory as /home/hts, rather than /home/USER where Kodi is installed. Log snippet from tvh 4.3-1986~g09a2c71ab:

2021-12-25 17:20:14.793 xmltv: /usr/bin/tv_grab_zap2epg: grab /usr/bin/tv_grab_zap2epg 2021-12-25 17:20:14.794 spawn: Executing "/usr/bin/tv_grab_zap2epg" 2021-12-25 17:20:14.799 spawn: /usr/bin/tv_grab_zap2epg: line 27: cd: /home/hts/.kodi/userdata/addon_data/script.module.zap2epg: No such file or directory 2021-12-25 17:20:14.812 spawn: python: can't open file '/home/hts/.kodi/addons/script.module.zap2epg/zap2epg.py': [Errno 2] No such file or directory 2021-12-25 17:20:14.813 spawn: cat: /home/hts/.kodi/userdata/addon_data/script.module.zap2epg/xmltv.xml: No such file or directory 2021-12-25 17:20:14.814 xmltv: /usr/bin/tv_grab_zap2epg: no output detected 2021-12-25 17:20:14.814 xmltv: /usr/bin/tv_grab_zap2epg: grab returned no data

I changed the file references in tv_grab_zap2epg to point to the USER/.kodi directory and it runs... ADDON_HOME="/home/USER/.kodi/userdata/addon_data/script.module.zap2epg" ADDON_DIR="/home/USER/.kodi/addons/script.module.zap2epg" XMLTV_OUTPUT="/home/USER/.kodi/userdata/addon_data/script.module.zap2epg/xmltv.xml"

...with an error ImportError: No module named request and it does not seem to find the xmltv.xml output file that is being run from the addon in Kodi. There is data in xmltv.xml file located /home/USER/.kodi/userdata/addon_data/script.module.zap2epg but tv_grab isn't pulling it.

2021-12-26 14:48:25.375 xmltv: /usr/bin/tv_grab_zap2epg: grab /usr/bin/tv_grab_zap2epg 2021-12-26 14:48:25.379 spawn: Executing "/usr/bin/tv_grab_zap2epg" 2021-12-26 14:48:25.431 spawn: Traceback (most recent call last): 2021-12-26 14:48:25.431 spawn: File "/home/USER/.kodi/addons/script.module.zap2epg/zap2epg.py", line 17, in 2021-12-26 14:48:25.432 spawn: import urllib.request, urllib.error, urllib.parse 2021-12-26 14:48:25.432 spawn: ImportError: No module named request 2021-12-26 14:48:25.463 xmltv: /usr/bin/tv_grab_zap2epg: grab took 0 seconds 2021-12-26 14:48:25.473 xmltv: /usr/bin/tv_grab_zap2epg: parse took 0 seconds 2021-12-26 14:48:25.473 xmltv: /usr/bin/tv_grab_zap2epg: channels tot= 56 new= 0 mod= 0 2021-12-26 14:48:25.473 xmltv: /usr/bin/tv_grab_zap2epg: brands tot= 0 new= 0 mod= 0 2021-12-26 14:48:25.473 xmltv: /usr/bin/tv_grab_zap2epg: seasons tot= 0 new= 0 mod= 0 2021-12-26 14:48:25.473 xmltv: /usr/bin/tv_grab_zap2epg: episodes tot= 0 new= 0 mod= 0 2021-12-26 14:48:25.473 xmltv: /usr/bin/tv_grab_zap2epg: broadcasts tot= 0 new= 0 mod= 0

Perhaps I missed a step in the initial setup and my manual copy and file reference edits are not needed. How do I get past this error so that tvh can import the generated xmltv.xml file?

Phaelkyn commented 2 years ago

A little online searching and I got past the import error by replacing the line import urllib.request, urllib.error, urllib.parse with import urllib and replacing all instances of urllib.request, urllib.error, and urllib.parse with just urllib.

2021-12-27 12:04:00.000 xmltv: /usr/bin/tv_grab_zap2epg: grab /usr/bin/tv_grab_zap2epg 2021-12-27 12:04:00.004 spawn: Executing "/usr/bin/tv_grab_zap2epg" 2021-12-27 12:04:54.024 xmltv: /usr/bin/tv_grab_zap2epg: grab took 54 seconds 2021-12-27 12:04:54.029 xmltv: /usr/bin/tv_grab_zap2epg: parse took 0 seconds 2021-12-27 12:04:54.029 xmltv: /usr/bin/tv_grab_zap2epg: channels tot= 56 new= 0 mod= 0 2021-12-27 12:04:54.029 xmltv: /usr/bin/tv_grab_zap2epg: brands tot= 0 new= 0 mod= 0 2021-12-27 12:04:54.029 xmltv: /usr/bin/tv_grab_zap2epg: seasons tot= 0 new= 0 mod= 0 2021-12-27 12:04:54.029 xmltv: /usr/bin/tv_grab_zap2epg: episodes tot= 0 new= 0 mod= 0 2021-12-27 12:04:54.029 xmltv: /usr/bin/tv_grab_zap2epg: broadcasts tot= 0 new= 0 mod= 0

tv_grab_zap2epg still doesn't seem to pull data from the xmltv.xml file, though. I assume that I am still missing a step during the initial setup.

Phaelkyn commented 2 years ago

This appears to have resolved itself after a couple of days. I do suggest adding some additional steps to the setup instructions for users who installed TVH as user hts and will need to move the tv_grab_zap2epg file and edit the file references to point to where kodi is installed. [unless I did something wrong during the setup and this isn't necessary]

Thanks for creating this epg tool!

2022-01-01 12:04:00.008 spawn: Executing "/usr/bin/tv_grab_zap2epg" 2022-01-01 12:04:54.352 xmltv: /usr/bin/tv_grab_zap2epg: grab took 54 seconds 2022-01-01 12:04:54.379 xmltv: /usr/bin/tv_grab_zap2epg: parse took 0 seconds 2022-01-01 12:04:54.379 xmltv: /usr/bin/tv_grab_zap2epg: channels tot= 56 new= 0 mod= 0 2022-01-01 12:04:54.379 xmltv: /usr/bin/tv_grab_zap2epg: brands tot= 0 new= 0 mod= 0 2022-01-01 12:04:54.379 xmltv: /usr/bin/tv_grab_zap2epg: seasons tot= 1292 new= 723 mod= 569 2022-01-01 12:04:54.379 xmltv: /usr/bin/tv_grab_zap2epg: episodes tot= 872 new= 392 mod= 480 2022-01-01 12:04:54.379 xmltv: /usr/bin/tv_grab_zap2epg: broadcasts tot= 1370 new= 744 mod= 3 2022-01-01 12:04:54.379 xmltv: /usr/bin/tv_grab_zap2epg: scheduling save epg timer