Search code examples
kodi

Kodi (fka Xbmc) scraper for onlinetvrecorder (otr) recordings


I would like scrape information for recordings from onlinetvrecorder (otr) in Kodi. Unfortunately the scrapers available can't handle the file format which is like

Django_Unchained_15.07.03_22-45_sf2_165_TVOON_DE.mpg.mp4.avi

Renaming is not an option, since the filename is a key for otr. I know there is a scraper called xbmc-otr, but it never left beta status and seems to be outdated.

Any suggestions, on how to correctly display those files in Kodi? Has anybody written or started a scraper for otr?


Solution

  • After some research I found a solution to the problem. Put the following in %appdata%\Kodi\userdata\advancedsettings.xml (advancedsettings.xml does not exist in advance, you have to create it)

    <advancedsettings>
      <video>
        <cleanstrings action="prepend">
         <regexp>_\d\d\.[0-1]\d\.[0-3]\d_[0-2]\d-[0-5]\d_</regexp>
        </cleanstrings>
      </video>
    </advancedsettings>
    

    The regexp <regexp>_\d\d\.[0-1]\d\.[0-3]\d_[0-2]\d-[0-5]\d_</regexp> matches the timestamp in the otr filename, so that everything right of the match (at the end of the file name) is removed. See the official Kodi documentation for further reference. The remaining file name can be handled by the scrapers shipped with Kodi. Despite of the relatively coarse regexp I added, all my otr movies were recognized correctly.

    The solution is tested with Kodi 15.2 (Isengard), but should work with all versions that support the cleanstrings option.

    EDIT:

    A similar soltuion works for TV Shows. The only requirement is that the file name contains season and episode information like S01E02 for example.

    <tvshowmatching action="prepend">
        <regexp>_[Ss]([0-9]+)[Ee]([0-9]+)([^\\/_]*)</regexp>
    </tvshowmatching>