Custom Scripts
Configure a script notification
- Save the script on the machine running Tautullby. For a container, mount the script folder and use its path inside the container.
- Open Settings → Notification Agents → Add a new notification agent → Script.
- Choose the script folder and file, then select the triggers that should run it.
- To narrow when it runs, add custom conditions.
- 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.
| Variable | Value |
|---|---|
EMBY_URL | The configured Emby server URL. |
EMBY_TOKEN | The configured Emby API key. |
EMBY_USER_TOKEN | A user-scoped server token when available. |
TAUTULLBY_URL | The local URL of this Tautullby instance. |
TAUTULLBY_PUBLIC_URL | The configured public URL or the HTTP root when only a path is available. |
TAUTULLBY_APIKEY | The Tautullby API key. |
TAUTULLBY_ENCODING | The app's system encoding. |
TAUTULLBY_PYTHON_VERSION | The Python version running Tautullby. |
TAUTULLBY_SCRIPT_LOG_PATH | The 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