tvheadend, ATSC and epg...

  • Thanks for your patience and work edit4ever, I think we're all inching closer and closer to a stand-alone system. I have the odroid c2, LE 7.1, tvheadend 4.0.9, emby still on separate desktop, and been trying like crazy to get zap2xml working smoothly.

    I had a question on what I may had done wrong. With the latest dropbox zip file, it installed a script.module.zap2xml-master directory in addons and the userdata/addon_data directory only had the settings.xml file in it. The log file returned the no directory exists error, so I putty'd in and renamed the ...zap2xml-master directory to just ...zap2xml. It still didn't seem to work, so I then manually copied everything to the userdata/addon_data/script_module.zap2xml directory. Once I rebooted, the xmltv.xml file was created, but it stopped after the first program was written. All the channels were written right.

    Here is the exception error in the log file, thanks again:


  • UnboundLocalError: local variable 'cast' referenced before assignment

    The "cast" error has been fixed. I missed pushing that fix but Schmell caught it and submitted the pull request. Just redownload the zip and reinstall.

    I don't know how to keep github from adding the branch to the zip download from github and so until I can get this uploaded to the LE repo, the directory for the addon will have -master added to it. If you download my dropbox version - it has the proper folder name. Dropbox - script.module.zap2xml.zip

    Let me know if that fixes your issue.
    [hr]


    edit4ever: Are you missing the logging.ini file in the kodi addon?

    I'll have to ask atsrilchuk and run a test - I'm no longer using SD, I just posted the current build of his project. He's been making some updates, so maybe something went wrong...it worked very well for me before I got zap2xml up and running.

    Edited once, last by edit4ever (October 15, 2016 at 2:50 PM).

  • Thanks, I downloaded the latest, uninstalled and deleted the directories and reinstalled. It created the addons folder and the userdata addon_data folder with the settings.xml file, but now it isn't showing up in tvheadend, so I think that is the tv_grab file not being triggered. It seems like the initial run isn't going through, so not sure if that is kodi or the add-on. I'm still not used to the log files, but I didn't see any obvious errors. I know how to run zap2xml manually in ubuntu and windows, but haven't figured out how to do it in kodi yet. I tried running the zap2xml.py, but it isn't grabbing the settings.xml file so it can't log into zap2it. Any idea which log file would show where kodi is having trouble with the add-on or maybe it is something else. Thanks again, no rush

    Edit: Here's the add-on log part where it says it is running the things needed, but no xmltv.xml file is created and the tv_grab entry isn't in tvheadend, in case that helps.

    Edited once, last by StitchedChin (October 15, 2016 at 8:16 PM).


  • Edit: Here's the add-on log part where it says it is running the things needed, but no xmltv.xml file is created and the tv_grab entry isn't in tvheadend, in case that helps.

    Looking at that log - it seems that you have multiple grabbers running. That includes the zap2xml grabber as it is being run by tvheadend in your log.

    That means that you likely have the channels epg source set to the other grabber - so zap2xml will not actually grab any data and create the xmltv.xml file. Try setting a couple of channel epg sources to the zap2xml. Also, for now - you could try turning off the other grabbers, rebooting, and making sure that zap2xml is the only grabber enabled. Then check the channel epg sources are set to zap2xml, run the grabber and see what happens. If it looks like it is not working - post that log.
    [hr]


    edit4ever: Are you missing the logging.ini file in the kodi addon? I get:

    Code
    Traceback (most recent call last):
     File "/storage/.kodi/addons/tools.module.sd2xmltv/sd2xmltv.py", line 375, in <module>
       logging.config.fileConfig(u"logging.ini", disable_existing_loggers=True)
     File "/home/chewitt/LibreELEC.70-official/build.LibreELEC-WeTek_Play.arm-7.0.2/Python-2.7.11/.install_pkg/usr/lib/python2.7/logging/config.py", line 77, in fileConfig
     File "/home/chewitt/LibreELEC.70-official/build.LibreELEC-WeTek_Play.arm-7.0.2/Python-2.7.11/.install_pkg/usr/lib/python2.7/logging/config.py", line 113, in _create_formatters
     File "/home/chewitt/LibreELEC.70-official/build.LibreELEC-WeTek_Play.arm-7.0.2/Python-2.7.11/.install_pkg/usr/lib/python2.7/ConfigParser.py", line 607, in get

    when running the grabber.

    Is there more to this log? I assume that the xmltv file is not being generated for you?

    Astrilchuk has updated the version in the develop branch and changed the name of logging.ini to loggin.cfg - but this shouldn't make a difference in the version I compiled.

    I can compile the develop branch later tonight to try.

    Edited once, last by edit4ever (October 15, 2016 at 11:14 PM).


  • Is there more to this log? I assume that the xmltv file is not being generated for you?

    No more log. The script fails. But if I copy the logging.ini file from github to the addon home/data folder, it works perfectly. The problem is not the name of the file, it is the lack of it.

    Regards.

    Edited once, last by jucaroba (October 16, 2016 at 10:06 PM).


  • edit4ever: if the code in your add-ons is stable you're welcome to submit them to our repo, or if you need some webspace to publish your own repo instead of using dropbox links (and then add your repo installer to our repo) to make updates easier for users; let myself or other staff know.

    chewitt Is there a wiki for submitting the addons to your repo? I think zap2xml is at the point of being ready for a 1.0 release.


  • chewitt Is there a wiki for submitting the addons to your repo? I think zap2xml is at the point of being ready for a 1.0 release.

    No wiki. You can submit a pull request (PR) to add the add-on to our main git repo, or if you'd prefer to manage your own repo, i.e. rates of change are still higher and you want direct control over changes and publishing, you can PR your repo installer to our repo. If you want to go the 'own repo' route we'd be happy to provide some edit4ever.libreelec.tv webspace to serve files from, or you can abuse free github hosting. Whatever works for you and users works for us :)

  • Looks like some changes happening at zap2it.com - so I may wait a bit before releasing to see if they change the way the listings work.

    In the meantime, Schmell added some fixes, so updated release:

    v0.4.5.zip

    **** update - looks like site changes may have broken zap2it listings for now (using a popup for login window) ****

    Switch to TVguide option in the meantime while I look into a fix or while I build out the titan tv listings option (they're more supportive of this type of use)

    Edited once, last by edit4ever (October 20, 2016 at 4:00 PM).

  • -- Need a little github help here for my releases.

    When I make a release - it adds the version number to the addon folder inside the zip file. This makes the addon install like it's a different version when updating. I know the release zip name should add the version number but the I think the name of the folder inside shouldn't be changed.

    How do I make it keep the folder named script.module.zap2xml when making a release?

  • Awesome, thanks edit4ever, it looks to be working with that 0.4.6 update running tvheadend 4.2 on my odroid c2 with libreelec 7.1. I slowly narrowed my original error to that "3 login attempt, try logging out of zap2it" error before, even when I manually tried running it. Even when I went to the web address in a browser, zap2it was having issues unless I logged out and went back in, perhaps a cookie issue, but I was thinking they were cracking down on programs like this. Definitely working much better than manually copying over that xml file. Tvheadend 4.2 picked it up, couple reboots and the EPG was there to map and get going, much nicer than my earlier attempts. Now a few refining touches to tvheadend, ability to install emby on the odroid c2, maybe some native file conversion and I think it can be a complete stand alone solution. Thanks again!

    Edited once, last by StitchedChin (October 31, 2016 at 1:50 AM).

  • Issue I'm running into is the recording naming from tvheadend is not playing nice with MCEBuddy or Emby. It looks like tvheadend can't get the season and episode data from the xmltv file, so I just get "title-e#-subtitle". Maybe there is a setting I'm missing? Looks like they can't find show information with just the episode number, so the long running shows will be labeled E73 which might be season 4 episode 13. If I manually change the recording to title-S04E13-subtitle, it looks like it works properly again. Emby creates the NFO and MCEBuddy coverts and files it into the correct folder by show title. For now I'm getting tons of new folders based on the the full name of the recording and not just the show title.

    The season and episodes are listed on the zap2it tvschedule, but not sure what it looks like through the parser. Perhaps another tag is available besides this one?
    <episode-num system="dd_progid">EP02433645.0007</episode-num>

    I'll try to take a closer look at the py file tomorrow.

  • I'm on your latest 0.4.6 version.

    Oh yeah, I think I checked off the first option for extended details, but not the one that runs the -D parameter for program details. I think the other option just did the series category, -j? That should do the trick. With only 13 stations, it still works well for a 14 day grab. I'll try that later today and give an update, thanks!

  • Great, that does look like it is working more smoothly. Emby and tvheadend are picking it up, converting and filing it away it on the first try again. Thanks!

    I think the last little issue is the channel display-name are missing the channel number in the xmltv. Would that be a change in the py script?

    Here's what the entry looks like from 0.4.6
    <channel id="I20377.labs.zap2it.com">
    <display-name>0 KGTVDT</display-name>
    <display-name>0</display-name>
    <display-name>KGTVDT</display-name>
    </channel>

    Here's what it looks like from a windows install of zap2xml.exe
    <channel id="I20377.labs.zap2it.com">
    <display-name>10.1 KGTVDT</display-name>
    <display-name>10.1</display-name>
    <display-name>KGTVDT</display-name>
    <icon src="http://images.zap2it.com/station_logo/abc_affiliate.gif" />
    </channel>


  • I think the last little issue is the channel display-name are missing the channel number in the xmltv. Would that be a change in the py script?

    That's another setting in the options page. Make sure that "Channel name first" is not turned on.

    Of course - you will have to enable the "update name" in the epg grabber tvheadend setting if you want them to update from the xmltv file.

    Otherwise - you can just change the name on the channels page in tvh and it will update on reload in kodi.

  • Yeah, I swapped between those options just to see what they would do, but it just changed those entries from 0 KGTVDT to KGTVDT 0. I had it setup originally how you suggested.

    I was thinking tvheadend was throwing in extra parameters, so ran zap2xml manually in Putty. I still got 0s for the channels. I'm not too familiar with python or perl, but looks like the zap2xml perl script still grabs the channel with similar code, but python isn't catching it. If zap2it's website made any slight changes, I would expect the perl script would have the same issue, but that's only me right clicking and viewing the source on the zap2it website and not following exactly how the python script does it. It looks like channel is still being labeled and pointing to the channel numbers in the html, but not sure if that has changed any.

    This looks like where the 0s are being recorded in the python script, but I'm no where comfortable with the language.

    Code
    # match '.' or alphanumeric one or more time followed by anything
                    tmp = re.search(".*channel=([.\w]+).*",tnum)
                    if tmp:
                        tnum = tmp.group(1)
                    else: tnum = "0"