Skip to content

Python watchdog script that looks for new/remove/move filesystem events on cifs/nfs/others and sends a refresh request to Jellyfin API.

Notifications You must be signed in to change notification settings

pulpul-s/watchertoucher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 

Repository files navigation

watchertoucher

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.

Requirements

  • Python 3.6+
  • watchdog for filesystem monitoring
  • requests for jellyfin api calls

Usage

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

Changelog

watchertoucher 0.1.1:

  • Check if a library refresh is already running and re-schedule by delay_seconds
  • Fix stdout output new lines
  • Better handling of errors

watchertoucher 0.1.0:

  • Rewrite of the script logic to use Jellyfin API instead of fooling Linux inotify
  • Simplified and cleaned up the script behavior

About

Python watchdog script that looks for new/remove/move filesystem events on cifs/nfs/others and sends a refresh request to Jellyfin API.

Topics

Resources

Stars

Watchers

Forks

Languages