Kodi Community Forum

Full Version: Is there any way to add EPG data to recordings in a form that can be read by Kodi?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For a number of reasons, I watch all my recordings back by having added the record folder to Kodi as an unspecified source.

Unfortunately, this means that all I have is a file name for each show, whereas the EPG provides full metadata, plus a front cover for the show (I am using the tv_grab_zz_sdjson_sqlite).

Is there any way to add this additional information to the recording, in a format that will show up in Kodi?
You need to name your files in a way that Kodi's TV show scraper will understand, or you need to write a script that will get the EPG data from Tvheadend and convert it into Kodi's NFO format. The first option is trivial, the second more difficult.

Of course, the easiest method is using the HTSP client. But since you are purposefully choosing not to do so, perhaps posting in the forum dealing with other addons and scrapers will provide more useful responses.
(2018-03-26, 15:41)rpcameron Wrote: [ -> ]you need to write a script that will get the EPG data from Tvheadend and convert it into Kodi's NFO format

In case it's of any interest, I'm taking a crack at this right now. It'll be in Ruby though, don't know if that's any good to you.
Well, I thought I was getting most of the way there, I managed to produce this:


tvheadend:/srv/pvr/TVHeadend> cat 20180324_202000-Casualty-S32E29.nfo
<?xml version='1.0' encoding='UTF-8' standalone='true'?>
<episodedetails>
    <title>
        Casualty
    </title>
    <season>
        32
    </season>
    <episode>
        29
    </episode>
    <plot>
        Tragedy strikes on the day of Robyn and Glen&apos;s wedding and Jacob
        feels ignored by Elle. Meanwhile, Rash treats a woman who has suffered
        from anxiety since losing her fiancé and Alicia and Louise see to a
        young woman who has suffered a fall.
    </plot>
    <runtime>
        67
    </runtime>
    <playcount>
        0
    </playcount>
</episodedetails>

But I can't get kodi to import it.

The Ruby I have so far is linked below if anyone fancies a play. It makes the assumption that the tvheadend server is the same server as Kodi at the moment, and by that I mean it writes the .nfo files out in the same location as the .ts files. I can make it write them to a different rootpath fairly easily (ie if you had the pvr directory mounted in another location). There may be other tags (airtime?) that can be populated as well, but I thought this would be enough to prove the concept.. If I can get them importing..

https://gist.github.com/1cda289184d02c49...9bf78f6d03