Kodi Community Forum

Full Version: Zap2xml for ATSC in OpenELEC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
(2017-08-07, 00:25)edit4ever Wrote: [ -> ]Good question - maybe tvheadend on ubuntu doesn't support python based grabbers - but needs a perl based one??

If so - mine isn't going to work there - but the original zap2xml was done in perl. You can find that info here: http://zap2xml.awardspace.info/

But you'll have to configure it all through a terminal. But I'm guessing you're comfortable with that! :-)

The downloadable ZIP from following Setup Guide (which uses the Original zap2xml Perl Script), was helpful, although in my case the Automatic Script failed to identify that TVheadend had recognized tv_grab_file as an EPG Grabber, therefore I had to complete configuration "Manually".
"Feature": A separate CRON Job is required to run its EPG Grabber, unlike your Script where the EPG Grabber is run as a TVheadend CRON Job!

https://github.com/rocky4546/script.xmlt...-TVHeadEnd


I noticed TVheadend is able to recognize the above mentioned tv_grab_file (a simple BASH Script and not a Perl Script) from its "Description" Parameter.
Copying your V0.7.3 Wrapper into /usr/bin, I determined the reason your Wrapper was failing to be recognized as an Internal EPG Grabber was due to the Trailing Carriage Returns 0x0D (UNIX prefers just Line Feeds 0x0A), which is often an issue when Files have been Created under DOS/Windows.
With the Trailing Carriage Returns removed from your Wrapper, TVheadend does recognize your Script as an EPG Grabber!
NOTE: Within your Wrapper I had to Manually Code the Paths to your Tree, since your Tree is located within my own .kodi Directory (TVheadend being run by USER hts).

After allowing Write Access for your Script's Logging to your Tree within my own .kodi Directory (since TVheadend is being run by USER hts), your Python Script aborts with the following Error Message:

Traceback (most recent call last):
File "/home/houston/.kodi/addons/script.module.zap2xml/zap2xml.py", line 101,
in <module>
import mechanize
ImportError: No module named mechanize

Although the script.module.mechanize-0.2.6.zip I manually installed does not solve this issue with the missing mechanize module, no xmltv.xml is generated?
NOTE: KODI under Linux is not "Self Contained", since some Modules have to be installed manually from outside KODI...
Thanks for discovering the trailing CRs - I'll see if I can clean that all up!

As for the mechanize module - if you take a look at the addon.xml file - you'll see the three requirements are:

<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.mechanize" version="0.2.6"/>
<import addon="script.module.beautifulsoup" version="3.2.1"/>

If you have manually made sure those are installed - try removing those lines from the addon.xml file and see if it will run.

I assume you have setup a zap2sml account on the zap2it website, with a list of channel favorites and six hour grid enabled. And have also entered your user/pass into the zap2xml addon? Once you do that you can monitor the zap2xml grabber in the tvheadend log window. First run should pull a channel list but no shedules. Then you set the epg source for each channel in tvh and then run the grabber again. Then schedules should pull.

Leave the zapxml addon options at defaut until you get your first set of data (to speed up initial setup) then you can make changes like number of days and extra details (which take longer to download)
(2017-08-07, 16:14)edit4ever Wrote: [ -> ]Thanks for discovering the trailing CRs - I'll see if I can clean that all up!

As for the mechanize module - if you take a look at the addon.xml file - you'll see the three requirements are:

<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.mechanize" version="0.2.6"/>
<import addon="script.module.beautifulsoup" version="3.2.1"/>

If you have manually made sure those are installed - try removing those lines from the addon.xml file and see if it will run.

I assume you have setup a zap2xml account on the zap2it website, with a list of channel favorites and six hour grid enabled. And have also entered your user/pass into the zap2xml addon? Once you do that you can monitor the zap2xml grabber in the tvheadend log window. First run should pull a channel list but no shedules. Then you set the epg source for each channel in tvh and then run the grabber again. Then schedules should pull.

Leave the zapxml addon options at defaut until you get your first set of data (to speed up initial setup) then you can make changes like number of days and extra details (which take longer to download)

My Zap2it Account works fine with your Script on my Raspberry Pi 3 (LibreELEC 8.0.2).

After removing those 3 requirements from addon.xml, TVheadend still reports the machanize module is missing.

Would you happen to have URLs for those 3 ZIPs, which you know to work with V0.7.3?
Here are all the ubuntu modules from my kodi system. https://www.dropbox.com/s/bgq3j66g67zvgc...s.zip?dl=0

Python should be built in already. The others in there are for my tvh2kodi addon as well.

Not sure why you're having issues - these all install on their own on my Ubuntu kodi installation.
(2017-08-07, 17:37)edit4ever Wrote: [ -> ]Here are all the ubuntu modules from my kodi system. https://www.dropbox.com/s/bgq3j66g67zvgc...s.zip?dl=0

Python should be built in already. The others in there are for my tvh2kodi addon as well.

Not sure why you're having issues - these all install on their own on my Ubuntu kodi installation.

Sorry even with both ZIPs installed from your Ubuntu Modules, your script is still reporting the Machanize Modules is missing?
Try uninstalling my addon and installing the older 0.6.5 release - If that installs and the grabber shows up, let me know - that will help pinpoint any issues.

Also - if that installs and shows up - then try to upgrade to 0.7.2 (not the 0.7.3 that I gave as a test)
(2017-08-07, 18:35)edit4ever Wrote: [ -> ]Try uninstalling my addon and installing the older 0.6.5 release - If that installs and the grabber shows up, let me know - that will help pinpoint any issues.

Also - if that installs and shows up - then try to upgrade to 0.7.2 (not the 0.7.3 that I gave as a test)

Within a Virtual Machine running a "Fresh" Installation of Ubuntu 16.04.3, this time with only TVheadend and zap2xml having been added:

Watching closely the Beautifsoup and Mechanize Scripts installed automatically (seem to remember there was an error on the "Real" Machine, with only the HTS PVR having been installed outside KODI).

With zap2xml V0.6.5 there is still no tv_grab_zap2xml within the /usr/bin directory and your wrapper does not appear within TVheadend's List of EPG Grabbers
OK - I'm not exactly sure what is going on with the file not copying to the /usr/bin folder.

I've reset the permissions, header and crlf issues. Go ahead and install this version:

https://www.dropbox.com/s/4buxy1hzv2du8m...i.zip?dl=0

I'm guessing it still won't install the tv_grab_zap2xml file in the usr/bin folder - so if it's not there...copy it into that directory and set it's permissions as 755.

Then reboot and it should show up - it did on my ubuntu virtualbox.

And thanks for testing for me!
(2017-08-09, 16:26)edit4ever Wrote: [ -> ]OK - I'm not exactly sure what is going on with the file not copying to the /usr/bin folder.

I've reset the permissions, header and crlf issues. Go ahead and install this version:

https://www.dropbox.com/s/4buxy1hzv2du8m...i.zip?dl=0

I'm guessing it still won't install the tv_grab_zap2xml file in the usr/bin folder - so if it's not there...copy it into that directory and set it's permissions as 755.

Then reboot and it should show up - it did on my ubuntu virtualbox.

And thanks for testing for me!

Your Welcome!

Report on V0.7.3i:

1- Still had to manually copy your Wrapper into /usr/bin, zap2xml had not appeared within TVheadend's List of EPG Grabbers.
Additionally set Permission to 775 and Ownership to root.root, matching TVheadend's other tv_grab_* files within the /usr/bin directory

2- Manually hardcoded my own Home Directory within the Wrapper, otherwise the Wrapper will attempt to access those within hts's Home Directory.

3- Allowed Write Access to my .kodi/addons/script.module.zap2xml and .kodi/userdata/addon_data/script.module.zap2xml Folders (777).

4- Same Error Message concerning the mechanize Module.

Traceback (most recent call last):
File "/home/houston/.kodi/addons/script.module.zap2xml/zap2xml.py", line 101, in <module>
import mechanize
ImportError: No module named mechanize
can you confirm that mechanize has installed on your system?

That addon is included in the LibreELEC repository - but I haven't checked to see if it is in the base kodi repo.
(2017-08-10, 01:04)edit4ever Wrote: [ -> ]can you confirm that mechanize has installed on your system?

That addon is included in the LibreELEC repository - but I haven't checked to see if it is in the base kodi repo.

Confirmed: script.module.mechanize V0.2.6 was automatically installed when I first installed script.module.zap2xml V0.6.5!

I do not know how to determine which Repository script.module.mechanize was Downloaded from, although in this case it can NOT be from LibreELEC's Repository?
That's weird - yet your system is giving you an error that it is not there. I wonder if mechanize has an execution permission issue also??

Try running this and restarting kodi:

sudo apt-get install python-mechanize
BTW - can I ask why you are trying to do all of this in a virtual machineHuh If you want to use the system as your media server - just install actual ubuntu (or better yet LE) and boot to it. You can dual boot if you want to keep windows.
(2017-08-10, 01:18)edit4ever Wrote: [ -> ]That's weird - yet your system is giving you an error that it is not there. I wonder if mechanize has an execution permission issue also??

Try running this and restarting kodi:

sudo apt-get install python-mechanize

After installing python-mechanize I received the following Error Message:

Traceback (most recent call last):
File "/home/houston/.kodi/addons/script.module.zap2xml/zap2xml.py", line 102, in <module>
from BeautifulSoup import BeautifulStoneSoup
ImportError: No module named BeautifulSoup

Which I following with:

sudo apt-get install python-beautifulsoup

After which your Python Script ran, although zap2xml.py ended with the following exception:

Writing XML file: /home/houston/.kodi/userdata/addon_data/script.module.zap2xml/xmltv.xml

Exception
error<type 'exceptions.SyntaxError'>
Traceback (most recent call last):
File "/home/houston/.kodi/addons/script.module.zap2xml/zap2xml.py", line 2144, in <module>
main()
File "/home/houston/.kodi/addons/script.module.zap2xml/zap2xml.py", line 2116, in main
printProgrammes(fh)
File "/home/houston/.kodi/addons/script.module.zap2xml/zap2xml.py", line 1380, in printProgrammes
xdets = addXDetails(programs[p], schedule[station][s])
File "/home/houston/.kodi/addons/script.module.zap2xml/zap2xml.py", line 1608, in addXDetails
optList = ast.literal_eval(options["-V"])
File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 1
[,,,,,,,,,,,,,,,,,,,,]
^
SyntaxError: invalid syntax
(2017-08-10, 01:19)edit4ever Wrote: [ -> ]BTW - can I ask why you are trying to do all of this in a virtual machineHuh If you want to use the system as your media server - just install actual ubuntu (or better yet LE) and boot to it. You can dual boot if you want to keep windows.

The Virtual Machine is just for Testing, the quickest way to ensure I have a Clean Installation!
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48