Python watchdog
script that monitors filesystem events (create, delete, move) on network-mounted drives (CIFS, NFS, etc.) and triggers a library refresh on a Jellyfin server.
By default, it schedules the refresh one minute into the future, avoiding API spam when multiple filesystem changes occur in a short time window.
- Python 3.6+
watchdog
for filesystem monitoringrequests
for jellyfin api calls
pip install watchdog requests
Change at least jellyfin_url
,api_key
and mediafolder
parameters on the script.
You should set the mediafolder
variable as the parent folder that holds your media folders.
Python Watchdog will monitor the folder recusively and react to changes made in it.
Jellyfin API key can be created in Settings -> Dashboard -> API Keys
run:
./watchertoucher.py
- Rewrite of the script logic to use Jellyfin API instead of fooling Linux inotify
- Simplified and cleaned up the script behavior