Skip to main content

Custom Scripts

Configure a script notification​

  1. Save the script on the machine running Tautullby. For a container, mount the script folder and use its path inside the container.
  2. Open Settings → Notification Agents → Add a new notification agent → Script.
  3. Choose the script folder and file, then select the triggers that should run it.
  4. To narrow when it runs, add custom conditions.
  5. Enter any arguments the script needs and save the agent.

Use placeholders such as {username} or {session_id} in saved arguments. When entering test arguments manually, use example values such as --username viewer --session-id sample-session.

A script folder on a mounted path may require allow_mounted_folders = 1 in the Tautullby configuration. Make the script readable and, when required, executable by the account that runs Tautullby. Install any dependencies in the interpreter environment that runs the script.

Script environment​

Tautullby passes the following variables to scripts. Use the exact variable names shown.

VariableValue
EMBY_URLThe configured Emby server URL.
EMBY_TOKENThe configured Emby API key.
EMBY_USER_TOKENA user-scoped server token when available.
TAUTULLBY_URLThe local URL of this Tautullby instance.
TAUTULLBY_PUBLIC_URLThe configured public URL or the HTTP root when only a path is available.
TAUTULLBY_APIKEYThe Tautullby API key.
TAUTULLBY_ENCODINGThe app's system encoding.
TAUTULLBY_PYTHON_VERSIONThe Python version running Tautullby.
TAUTULLBY_SCRIPT_LOG_PATHThe path to script.log in the Tautullby logs folder.

Keep tokens out of script output and logs.

Test a Python script on Windows​

Open PowerShell and use the same Python environment that will run your script. If the script requires an extra package, install it with python -m pip install PACKAGE. Run the script with test values before enabling the notification agent.

python "C:\Scripts\notify.py" --username viewer --session-id sample-session