Posts by edit4ever

    In tvh have you enabled the zap2xml grabber and saved that setting? Have you setup your zap2it or tvguide username/password in the zap2xml add on settings? Have you setup favorite channels on the zap2it/tvguide website? In the tvh web interface have you connected your channels to the source epg zap2xml channels?

    All these need to be done to have everything run and be automated. Based on the fact that you can run it manually - and I assume that generated the correct xmltv.xml file - the first or last item above is likely your issue.

    Very hopeful for this update! Afer a clean install - the Hauppauge 950Q is seen in lsusb - but nothing shows up in tvheadend. Perhaps the frontend is not loading? Here is output of lsusb -v

    Not sure what to check next.

    ---- as an update, I checked dmesg when connecting the usb tuner and get the following:

    looks like an issue with the i2s audio?

    Schedules Direct for Tvheadend (sd4tvh) addon is now ready for testing!!
    Thanks to astrilchuk and primaeval for their work taht I merged/morphed into this. The code is not optimized and needs further consolidation, but it has reached a point of needed some feedback from other users.

    The sd4tvh addon creates an xmltv grabber for tvheadend using the Schedules Direct JSON API. It also contains a kodi interface to manage your Schedules Direct lineups and configure a channel filter. The main purpose of the filter is to reduce download time and to fix a Schedules Direct timeout issue for those who use cable lineups (as these often start with 1000 channels).

    The channel filter uses a file to limit the number of channels downloaded from SD. This speeds up the time it takes to generate your xmltv.xml file and reduces the size of you sdcache.db file. There is an untested hdhomerun filter than can be used in place of the file based filter - if you have an hdhomerun setup. This should recognize the channels you have configured in the hdhomerun system and only download the necessary guide data. **As I do not have an hdhomerun - feedback is welcomed.

    Addon and source link is at the bottom of this post.

    To get started:

    • Download and install the sd4tvh addon
    • Run the addon and select Configure Settings and Options

      • Input your Schedules Direct username/password
      • Set the Number of Days to Download as desired (may want to set at 1 until you are sure everything is working)
      • If you have an HDHomerun setup

        • select Discover or IP in the HDHomerun Channel Filter

          • Discover - should find your device on the network
          • IP - if you know the hdhomerun ip address you can enter it here
        • Disable the File Based Channel Filter setting
      • If you do not have an HDHomerun

        • Leave the HDHomerun Channel Filter set to None
        • Leave the File Based Channel Filter enabled
      • Select OK
    • Select the Add Schedules Direct Provider Lineup (sd4tvh uses the JSON API for SD so the lineups on the SD website are not relevant)
      • Follow prompts to select country / zip code / lineup
    • You can review/remove your existing lineups by selecting Remove Schedules Direct Provider Lineup

      • List of subscribed lineups will display
      • Select lineup you wish to remove
    • Select Add & Remove Channels from Lineup ***(Not needed if using HDHomerun filter)*** and follow prompts

      • Select the lineup you wish to add/remove channels for
      • If there are new channels (all show here the first time) the New Channels Found prompt appears
        • Select which channels to include in downloads
      • The Excluded Channels List prompt shows channels that will not be downloaded (any not selected above will now be here)
        • Select which channels to include in downloads
      • The Included Channels List propmt shows channels that will be downloaded
        • Select which channels you do NOT want included in downloads
      • Channels will now be saved to a file called filter.cfg in the addon userdata folder - this text file can be manually edited if desired
    • Login to the tvheadend web interface to configure the sd4tvh grabber (I will include basic tvh setup info for those who need it)

      • Go to the CONFIGURATION > CHANNEL/EPG > EPG GRABBER MODULES tab
      • Select the Internal: XMLTV: tv_grab_sd4tvh is a simple wrapper for sd4tvh.py grabber (if missing - reboot)

        • click Enabled
        • click Save
        • click Re-run internal EPG Grabbers
        • tvheadend will now run the sd4tvh grabber and get a list of the channels (you can monitor progress in the bottom log window)
      • Go to the CONFIGURATION > CHANNEL/EPG > CHANNELS tab

        • For each channel, double click in the EPG source column and select the correct schedules direct channel feed
        • click Save
      • Return to the CONFIGURATION > CHANNEL/EPG > EPG GRABBER MODULES tab

        • click Re-run internal EPG Grabbers
        • tvheadend will now run the sd4tvh grabber and get a program list for the channels (you can monitor progress in the bottom log window)
        • When it finishes running, the Electronic Program Guide tab should be populated

    You can change your lineups and channels whenever you want, but to get the data to updated in tvheadend you need to rerun the internal grabber. The cron is set to update twice a day - you can adjust the cron time on the CONFIGURATION > CHANNEL/EPG > EPG GRABBER tab.

    I'm hoping to add some of the options from my zap2xml addon in the near future.
    Please provide any and all issues or feedback!! Thanks :)



    1/10/2017 - inital version 0.2.1

    Download the addon: Releases · edit4ever/script.module.sd4tvh · GitHub

    Source Code: GitHub - edit4ever/script.module.sd4tvh: Schedules Direct for Tvhheadend


    Couldn't get it working using the 0.6.1 update. However, had the chance to disable program icon download and that brought things back to "normal". Things are good again :)

    The "fix" should have been adding str() to the icon fn line 349. I think I was rushing and did it wrong. Try changing the icon section starting at line 348 in zap2xml.py to the following:

    Code
    if "-I" in options:
                        fn = os.path.join(cacheDir,"I" + str(cp) + ".js.gz")
                        if not os.path.isfile(fn):
                            data = getURL(urlRoot + "gridDetailService?rtype=pgmimg&pgmId=" + cp)
                            if data: #sometimes we fail to get the url try to keep going
                                wbf(fn, data)
                                log.pout("[i] Parsing: " + cp,'info')
                        parseJSONI(fn)[/i]


    If that doesn't work - I'd love to see the log error. Thanks!

    File "/home/osmc/.kodi/addons/script.module.zap2xml/zap2xml.py", line 350, in on_td
    fn = os.path.join(cacheDir,"I" + cp + ".js.gz")
    TypeError: cannot concatenate 'str' and 'int' objects

    Disable the "download program icons" setting. I believe something may have changed on the screener site that is messing that up.

    After you disable - you can rerun the internal grabber and it should work again.

    I think I can just convert the the 'cp' to a string and it will work again - but I'll have to do some testing.

    ---
    Try updating to this version and test to see if the program icons download: script.module.zap2xml-0.6.1.zip


    Any suggestions on how to get the channel icon feature to work? Have it enabled in the add-on but doesn't seem to be doing anything. Thanks!


    It should have downloaded the icons to the userdata/addon_data/script.module.zap2xml/icons folder. You can tell kodi to use this folder for the channel icons. You can also log into tvheadend and under the channels tab - highlight the channels, click the reset icon button and the save button. This should then read the icon url from the xmltv file.

    I personally think the icons downloaded are low resolution and don't look that good in the interface. I use the icons from the following zip as a starting point to attach the version I like. (In my case the white ones look best)

    Dropbox - tv_channel_icons_pack_by_ati711-d4a0spa.zip

    OK - let's try not using the hdhomerun filter just to see if we get a channel listing. Go into the sd2xmltv addon settings and turn off hdhomerun and turn on file based channel filter. Set the number of days to 0. Rerun the internal grabber in tvheadend.

    -- this won't add program data - but should create a file called filter.cfg in your userdata/addon_data/tools.module.sd2xmltv folder.

    OK - the killed message has to do with too much data trying to be downloaded. I'm guessing you have a cable channel lineup (likely hundreds of channels) -- you'll need to use the channel filter to lower the number. Now that you have a lineup set - you can disable the script.schedules.direct addon and return to setting up the sd2xmltv grabber.

    In the kodi addons - set the sd2xmltv days to download to 0. Since you're using an HDHomerun - you can set that channel filter to discover. Now since I don't have one of those devices - I've been unable to test this setting...but let's see what happens. File based channel filter should be off.

    In the tvh web interface - try to run the sd2xmltv grabber and see what happens.

    OK I see - this grabber uses a different lineup as it pulls from the SD JSON service. There are two ways to set this up.

    First - if you know how to ssh into your system - navigate to the /storage/.kodi/addons/tools.module.sd2xmltv folder and run the following command:

    python sd2xmltv.py - u USERNAME - p PASSWORD -m (replace USERNAME and PASSWORD with your credentials)

    This should bring up the lineup configuration prompts...just follow along and when you are done you can exit and rerun the internal grabber from the tvh web interface.

    The second way is to temporarily add a different addon that has a kodi based lineup configuration for schedules direct. I'm going to try to work this into the sd2xmltv addon - but for now you can load the addon, run the lineup setup and then disable the addon when finished. It will have saved the lineup settings in the SD json servers. -- note you may want to set the number of days to download to 0 or 1 as you don't really want this addons data.

    Here is the link to that addon: script.schedules.direct-master.zip

    One of those two methods should get your lineup setup in the SD servers.

    The file exists, but it's empty. Is there something that needs to be done to run the script from within koi? I just enabled it and then enter my SD credentials. I've tried disabling and enabling it, but nothing seems to happen.


    You need to log into the tvheadend web interface and setup the sd2xmltv grabber as enabled. Then reboot - the grabber should run after a few minutes (you can watch the log window at the bottom) when it finishes, you will need to connect the epg source for the channels under the CONFIGURATION > CHANNELS/EPG > CHANNELS tab. Once you have connected the epg source for each channel you can rerun the internal grabber from the CONFIGURATION > CHANNELS/EPG > EPG GRABBER tab and it should donwload the program data.