Xmbc

From RARForge
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Inotify / Prowl - Watch Script

Watch directory(s) - Update XMBC library on change and notify via Prowl
  • This script will watch a given directory(s) and sub directories for Video files (or any other files if needed)
  • If a file is created, it will update XBMC library
  • If a file is deleted, it will clean the XBMC library
  • It will notify via Prowl (if enabled)
    • It will group actions together if multiple (dirs/files) are created/deleted (default 60 seconds)

Download: xmbc_inotify.pl

Download: https://www.prowlapp.com/static/prowl.pl * only required if you enable prowl notifications

Start on Boot

/etc/rc.local
screen -dmS inotify /usr/local/bin/xbmc_inotify.pl


Lang perl

Modules

use strict;
use Linux::Inotify2;
use Path::Class;
use Number::Bytes::Human;
use File::stat;
use Data::Dumper;
## JSON rpc call
use LWP::UserAgent;
use HTTP::Request;
use JSON::PP;