Keep track of your viewing history - without installing extra Kodi plugins.
- Checkout this project to your computer (or just copy
main.py
,config-template.ini
andrequirements.txt
). - Make sure that at least Python 3.9 is installed.
- Configure a virtual environment for
Python to install the necessary libraries inside it. This way you won't need
administrative access and you are independent of any changes in installed
system Python libraries. Go to the directory where you put the files in step 1
and execute the command:
python3 -m venv venv
- Now install the libraries with the command:
venv/bin/pip3 install -r requirements.txt
- Before running the script for the first time, prepare Kodi: go to Settings โ Services โ Webserver and activate "Allow control of Kodi via HTTP". It's advised to set a password or else anyone in your network will be able to control Kodi. More information can be found here.
- Copy
config-template.ini
toconfig.ini
and edit it to contain your data. Use the same values you entered in Kodi in the previous step. - Now you can run
main.py
, which will write its output to standard out if you don't give a filename as target.
For this to be useful, the script should run periodically. This may be achieved using Cron, e.g. with a line like this in your user's crontab:
*/5 * * * * /path/to/kodi-historian/venv/bin/python3 /path/to/kodi-historian/main.py /writable/path/to/movies.log
Now you collect a viewing history in steps of 5 minutes.