xmltv grabber solution for Tvh and North America...

  • I just came across this sd2xmltv project at github...I compiled the addon for Kodi...installed as instructed and voila! The addon generated an xmltv file from Schedules Direct for me. Of course, this will require having a SD account - but now you can pull the EPG info on the same system you're running LE on!

    Here is the github link: GitHub - astrilchuk/sd2xmltv: A Schedules Direct to xmltv converter

    Not sure why this hasn't been submitted to the kodi repo - but something worth getting added to the LE repo? I've submitted a note to the author as he mentiond that he was still working on the project and was going to enable icon information in the xmltv file.

    If there are any questions on how I enable - let me know!


  • I just came across this sd2xmltv project at github...I compiled the addon for Kodi...installed as instructed and voila! The addon generated an xmltv file from Schedules Direct for me. Of course, this will require having a SD account - but now you can pull the EPG info on the same system you're running LE on!

    Here is the github link: GitHub - astrilchuk/sd2xmltv: A Schedules Direct to xmltv converter

    Not sure why this hasn't been submitted to the kodi repo - but something worth getting added to the LE repo? I've submitted a note to the author as he mentiond that he was still working on the project and was going to enable icon information in the xmltv file.

    If there are any questions on how I enable - let me know!

    Brilliant

    thank you for pasing this on

    I defintely 2nd this for addition to the LE repo !

  • I'm looking into the script to try to fix the missing icon issue...but I don't work in python & haven't built a grabber before - so I'm not exactly sure what I'm looking for.

    The good news is the cached database that the script pulls from SD has the logo information in it. So it seems it's just a matter of getting that into the parser so it builds into the xmltv file. From what I can tell, there are references in the various scripts to the logo or stationlogo - but it doesn't output. I'm hoping it's just a simple naming issue - could be the code was written before the word "logo" was finialized for SD. Or maybe it just need to be added as a yield or return function.

    My eyes are blurry from trying to make sense of it - so hopefully someone else will take a look when they have a chance. I'm just happy to a simple working SD grabber for North America!

    One other item -- before this would be considered for adding to the repo -- someone may want to rework the code for the username / password function of the plugin. Right now it's saved in the clear. Just an FYI.

  • Found a fix for a complete genre list for those who want it...looks like the code was already in there just hashed out. Here are the changes to make on lines 357-360 of the sd2xmltv.py file

    [code=php]# self._add_program_categories(p, channel, airing, program)

    for genre in program.genres:
    p.add_category(genre)[/php]

    You basically hash out the self._add_program_categories(p, channel, airing, program) line and delete the has in front of the next two lines.

    Now all genres will be output into the xmltv file!

    Now if I can just get the folks at tvheadend to pass through the complete category list instead of matching the DVB string - I'll be much happier!


  • Now if I can just get the folks at tvheadend to pass through the complete category list instead of matching the DVB string - I'll be much happier!

    did you opened an ticket at the Tvh issue tracker ?


  • did you opened an ticket at the Tvh issue tracker ?

    Yes - the first response was to add the "missing" genres to the epg.c file

    My response was that I don't want to match the short DVB list as the US uses a lot of other types of genre listings and I want those to just pass through.

    Haven't received a response to that yet.


  • I am new to this whole thing and have managed to get to where I am now by following guides and copying code verbatim - even though I really have no idea what the code means. I am hoping you can provide an easy to follow guide that walks me through how to install/enable the epg grabber. There doesn't appear to be any such guide online, other than guides for the technically inclined.

    I currently have TVHeadend installed and configured correctly on a RPI backend (running libreelec) with a TVHeadend Front End on Kodi (Raspbian) running on another RPI. I also just purchased a Schedules Direct membership.

    Any help would be great


  • Any help would be great

    I assume you have downloaded the sd2xmltv addon: tools.module.sd2xmltv-0.1.3.zip

    If you have installed that and setup it's configure screen with your schedules direct login info...you should see an sd2xmltv grabber on the tvheadend web interface under the CONFIGURATION > CHANNEL/EPG > EPG GRABBER MODULES tab. You'll need to enable this grabber and any other grabbers that are enabled.

    Now, you'll need the grabber to run for the first time to pull the channel list from the lineup you set on the schedules direct website. You can force it to run by clicking the "Re-run internal EPG grabbers" button on that same tvheadend tab. I would suggest opening the logging window at the bottom of the screen so you can watch it run.

    When it has finished, it should have listed a number of new channels in the logging screen, but you will not have programs yet. Now you need to go to the CONFIGURATION > CHANNEL/EPG > CHANNELS tab. Here you will see an EPG source column that is likely blank for all your channels. If you double click in the white space in that column, you should get a dropdown of the channels that the sd2xmltv grabber pulled. Select the correct channel for each of the channels that you have and now your EPG source will be set.

    Run the internal grabber again and you should see program listings when it completes. Please note that it my take a little longer for the first run as it has to pull program data for all the channels for a lot of days!

    If you have other questions - just ask! :)

  • Thank you for the quick reply! However, its best not to assume anything with me. I have not downloaded it because....I have no idea how to. Since I am using Raspbian on my Pi, I have no idea what code to use to download and run it.


  • Thank you for the quick reply! However, its best not to assume anything with me. I have not downloaded it because....I have no idea how to. Since I am using Raspbian on my Pi, I have no idea what code to use to download and run it.

    If you're running raspbian - you can download the link in the previous post and put it in the kodi/userdata/download folder. Then from inside of kodi, you can go to the addon section, select install from zip and navigate to your download folder and sleect the zap2xml file that you downloaded.

    Do you know how to access the tvheadend web interface?

  • If you're running raspbian - you can download the link in the previous post and put it in the kodi/userdata/download folder. Then from inside of kodi, you can go to the addon section, select install from zip and navigate to your download folder and sleect the zap2xml file that you downloaded.

    Do you know how to access the tvheadend web interface?

    I was able to get a little farther but I think I am not doing it in the right way. I currently have TVHeadEnd running on a Libreelec backend RPI and Raspbian running another RPI acting as the front end. Through trial and error, I finally managed to install the add-on onto the Raspbian Kodi system and was able to configure it within Kodi. However, it is not showing up in the EPG Grabber modules on the TVH web interface.

    This made me think that I was supposed to install the add-on on the same RPI as the TVH interface. I attempted to redo the same steps on took on this RPI but was met with "Read-only" errors.

    Here are the specifics:
    I downloaded the zip file and copied the unzipped folder to the sd-card containing the OS.
    I then used the move command to move the file from its location to /kodi/addons.
    From my original attempt, I was then able to see the add-on and configure it within Kodi, however, when I attempted to move the same file using the same command with the Libreelec RPI, I was met with "Read-only" errors. I image this because Libreelec is a read-only OS by design.

    Any thoughts?

  • To make it easier - just download the file to a usb drive. Plug that into the LibreELEC pi and install the addon from zip.

    You should disable the addon on the rasbian pi as it will be easier to just have it running on the same system as the tvh backend.

    Hopefully you can see the LibreELEC pi on a screen so you can configure the addon with your credentials. Then you can set things up from the tvh web interface.

    Let me know how that goes.


  • To make it easier - just download the file to a usb drive. Plug that into the LibreELEC pi and install the addon from zip.

    You should disable the addon on the rasbian pi as it will be easier to just have it running on the same system as the tvh backend.

    Hopefully you can see the LibreELEC pi on a screen so you can configure the addon with your credentials. Then you can set things up from the tvh web interface.

    Let me know how that goes.

    It definitely made it easier after I realized my Mac was reformatting the zip file with a different name. So, I was able to install the add-on and configured it. I also have it selected in the TVH interface, but now I have another problem.

    When I look at the log it says "No output detected". Here is the text:

    Code
    2016-12-31 04:14:40.278 /storage/.kodi/addons/tools.module.sd2xmltv/bin/tv_grab_sd2xmltv: grab /storage/.kodi/addons/tools.module.sd2xmltv/bin/tv_grab_sd2xmltv2016-12-31 04:14:40.282 spawn: Executing "/storage/.kodi/addons/tools.module.sd2xmltv/bin/tv_grab_sd2xmltv"2016-12-31 04:14:40.646 spawn: cat: can't open 'xmltv.xml': No such file or directory2016-12-31 04:14:40.647 /storage/.kodi/addons/tools.module.sd2xmltv/bin/tv_grab_sd2xmltv: no output detected2016-12-31 04:14:40.647 /storage/.kodi/addons/tools.module.sd2xmltv/bin/tv_grab_sd2xmltv: grab returned no data


    Thoughts?

  • I assume you have setup your username/password in the sd2xmk add-on configure screen.

    If so, next it would help to see the other log file. There is a log in the .kodi/add-ons/tools.module.sd2xmltv folder. That one may have more info on why the grab failed.

    As an FYI - .kodi is a hidden folder so you can't browse to it from your Mac unless you setup your samba config file. I can help with that - but not until I get back to my system later tonight so I can look at the settings to share with you.


  • I assume you have setup your username/password in the sd2xmk add-on configure screen.

    If so, next it would help to see the other log file. There is a log in the .kodi/add-ons/tools.module.sd2xmltv folder. That one may have more info on why the grab failed.

    As an FYI - .kodi is a hidden folder so you can't browse to it from your Mac unless you setup your samba config file. I can help with that - but not until I get back to my system later tonight so I can look at the settings to share with you.


    I am able to SSH in. I have also added my username and password.

    In the .kodi/addons/tools.....etc folder, there is no log file. The only file I see related to logs is titled "logging.cfg", and does not contain anything related to a log.

    Not sure if I went wrong some place.

  • Sorry about the confusion on the log - I was thinking about my zap2xml addon not Astrilchuk's sd2xmltv addon.

    I haven't tried his in awhile - I will take a look tomorrow and see if it works on my system or if there has been some change that needs updating.

    In the meantime - you can try this info from the sd2xmltv github readme:Notes:
    For some reason Schecdules Direct doesn't seem to keep your headend configuration on the JSON servers.
    If you haven't used a JSON grabber before you will need to reconfigure your headend again using sd2xmltv
    +++++
    OpenELEC instructions:
    ssh into your openelec machine.
    cd /storage/.kodi/addons/tools.module.sd2xmltv
    python sd2xmltv.py -u <sduserid> -p <sdpassword> -m
    --- follow the onscreen prompts to add your headend.
    +++++

    That should run the script and generate an xmltv.xml file if it's working.

  • I went ahead and attempted your instructions here as well as the Kodi instructions to create an xmltv file listed on the same github page.
    Your instructions outputs: -sh: can't open sduserid: no such file

    The instructions on the Kodi page (./sd2xmltv.py --username sdusername --password sdpassword [--output ./xmltv.xml] [--days 14] [--hdhomerun discover|ip])outputs:
    -sh: ./sd2xmltv.py: Permission Denied
    -sh: ip]: not found

    Thank you for sticking with me through this.

  • interesting...looks like a permissions issue with the script...or file or folder.

    Just to make sure, I've recompiled atsrilchuck's current release version - so install this one and se if it changes anything: tools.module.sd2xmltv-0.1.3.zip


    ** One other thing....when you ssh in... don't run as ./sdxmltv.py run the following from the tools.module.sd2xmltv folder:

    python sd2xmltv.py -u sdusername -p sdpassword

    Edited once, last by edit4ever (December 31, 2016 at 4:26 PM).