[PP-SCRIPT] update_kodi

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
Post Reply
Posts: 4
Joined: 03 Aug 2015, 20:43

[PP-SCRIPT] update_kodi

Post by svenglar » 07 Nov 2015, 23:10

This is a very simple script that will hit Kodi's HTTP API to trigger a refresh of the video library:

In order to use this, the "Allow remote control via HTTP" setting under "web server" must be enabled.
It works best when triggered after video files have been sorted (for example, after VideoSort).

This has been tested, and is working with:
NZBGet => 16.2 and 16.3
Kodi => 15.2

Developer & Admin
Posts: 7361
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [PP-SCRIPT] update_kodi

Post by hugbug » 07 Nov 2015, 23:16

Thanks for sharing the script.

Posts: 42
Joined: 19 Nov 2013, 12:07

Re: [PP-SCRIPT] update_kodi

Post by jackiass2 » 22 Nov 2015, 06:11

I'm getting:

Code: Select all

Kodi is not running; skipping update
Kodi 15.1
Nzbget 16.3
OS: OpenElec 5.95.2
Hardware: RPi2.arm
Port: 80

IP and Port are the same ones that work with the Kore app and other remote controllers.
Is it btw OK to use localhost as IP?

Posts: 4
Joined: 03 Aug 2015, 20:43

Re: [PP-SCRIPT] update_kodi

Post by svenglar » 22 Nov 2015, 20:01

The reason you're seeing that message is because of this check to see if Kodi is running:

Code: Select all

kodi_running="$(/usr/bin/pgrep kodi.bin)"
if [[ -z $kodi_running ]]; then
    echo "[DETAIL] Kodi is not running; skipping update"
    exit $SKIP
If Kodi is not running, then I skip the check. There's two reasons for this. The first is because the script will exit with and error code if curl can't reach its target. The second is because there's no point in trying to hit the API if it's not available locally.

I wrote this script to work in my environment where Kodi and NZBGet are running on the same Ubuntu 14.04 host. This has a major flaw in that, 1) it won't work if Kodi is on a different host than NZBGet, and 2) it won't work if

Code: Select all

/usr/bin/pgrep kodi.bin
doesn't find a running instance of Kodi.

Anyway, I just pushed a new release of the script with better error handling and true support for remote hosts. Please try the new version and let me know if you get any more error messages:

https://github.com/natemccurdy/nzbget-u ... ree/v1.1.0

Posts: 4
Joined: 03 Aug 2015, 20:43

Re: [PP-SCRIPT] update_kodi

Post by svenglar » 22 Nov 2015, 20:38

Release v1.1.1 is now available.


It fixes some formatting issues in the description comments that was causing the description to not display correctly in NZBGet's web UI.

Posts: 1
Joined: 29 Sep 2018, 06:28

Re: [PP-SCRIPT] update_kodi

Post by Whiteney07 » 29 Sep 2018, 06:54

This guide is to help you move your media to a new location without losing all of your current watched statuses, date added, last played, resume time (for shows/movies that you started watching and did not finish), etc.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest