Thursday, April 7, 2016

Email Notifications for Kodi / OpenELC (Part 2)


Getting it

The Difference Engine can be found at;

It's written in Python 3, and has been tested on Mac OSX using Pyzo (which comes with Python 3.4) and on Debian 7.9.  It should probably work on any other Linux system.  And it should probably work on Windows, assuming you have Python 3 installed.  It probably won't work on OSX natively, since it ships with Python 2.7.

Use git to clone the repository.  Alternatively, if you aren't using git and don't want to install it... you can just download the main script ( and the stylesheet template (stylesheet.css).  You'll also need to download the example config file, and modify it for your own settings (more on that later).

Running the Difference Engine

Run 'python3' from your command line or whatever your python environment uses.  The first time it runs, will try and create a new sqlite database, and populate it with data from your Kodi / OpenELEC media player.  Depending on the size of your library, this could take a long time.  At the moment, in order to help me with debugging, it spews out quite a lot of information so you'll know it's working busily.

Once the initial database has been created and populated, subsequent runs should be much faster.  Though, if you turn on the option to query the TVDB this can slow things down.


There is an example config file in the github repository.  Download it, rename it to thediffer.conf and fill in the appropriate details.  Some basics around the configuration;

  1. Scan days -- this is the number of days the differ will scan back to, looking for updates.  Generally, this depends on how frequently you schedule it to run.  If you run it daily, set the scan days to 1.  If you run it weekly, set the scan days to 7 (and so on).  The update option determines whether you want to issue Kodi with an update command before commencing with the scan (to make sure the media library is up-to-date).
  2. Email -- Set this option to True if you want to receive an email.  If left at False, it will simply dump out an html file (which you can either email using another app, or present using a webserver).  If set to True, make sure to fill in the details of your email provider
  3. TVDB -- if set to True, the differ will call the TVDB API, to find an IMDB identifier and (where available) use that to create live hyperlinks in the html.  You'll need a TVDB account for this to work.  It's a nice option, but completely unecessary.
  4. Styles -- modify this if you want to change the look of the emails.


  1. Thanks for sharing, nice post!

    Tìm hiểu thuốc pediakid cho trẻ cho trẻ có mấy loại hay tìm hiểu về sản phẩm máy đưa võng cho trẻ hay thuốc bổ cho trẻ mua ở đâu hay tìm hiểu tinh dầu toàn thân cho trẻ với và tìm hiểu địa chỉ bán thuốc cho trẻ với ở đâu uy tín tốt nhất

  2. Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. correo hotmail

  3. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also