Setup Steps

  1. Write the script — create a .py file with the three methods above
  2. Mount it into the ErsatzTV container at /app/scripted-schedules/scripts/
  3. Configure Jellyfin library sync:
    • Go to Media Sources → Jellyfin → Edit Libraries
    • Toggle sync to “ON” for Movies and TV Shows libraries
    • Without this toggle, ErsatzTV sees the libraries but imports zero media items
    • After toggling, click the scan/refresh icon to populate the media tables
  4. Configure the channel playout in the ErsatzTV web UI:
    • Go to your channel’s Playout settings
    • Set the playout command to: /usr/bin/python3 /app/scripted-schedules/entrypoint.py my_schedule
    • CRITICAL: You MUST use the explicit interpreter path (/usr/bin/python3). Direct script paths fail with Permission Denied even with chmod +x because ErsatzTV’s .NET Process runner cannot execute arbitrary files without a shell or explicit interpreter.
    • (where my_schedule is the filename without .py)
  5. ErsatzTV executes it — the entrypoint calls your script with the build_id