### Download and Install FFmpeg on Linux Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs FFmpeg and ffprobe binaries on Linux by downloading a tarball and copying them to the installation directory. Verifies the installation. ```bash sudo mkdir -p "$INSTALL_DIR/bin" curl -L -o /tmp/ffmpeg.tar.xz \ "https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz" tar -xf /tmp/ffmpeg.tar.xz -C /tmp/ sudo cp /tmp/ffmpeg-master-latest-linux64-gpl/bin/ffmpeg "$INSTALL_DIR/bin/" sudo cp /tmp/ffmpeg-master-latest-linux64-gpl/bin/ffprobe "$INSTALL_DIR/bin/" sudo chmod +x "$INSTALL_DIR/bin/ffmpeg" "$INSTALL_DIR/bin/ffprobe" # Verify "$INSTALL_DIR/bin/ffmpeg" -version ``` -------------------------------- ### Download and Install FFmpeg on Windows Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs FFmpeg and ffprobe binaries on Windows by downloading a zip archive and copying the executables to the installation directory. Verifies the installation. ```powershell New-Item -ItemType Directory -Force -Path "$InstallDir\bin" | Out-Null Invoke-WebRequest -Uri "https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip" ` -OutFile "$env:TEMP\ffmpeg.zip" Expand-Archive "$env:TEMP\ffmpeg.zip" -DestinationPath "$env:TEMP\ffmpeg_extract" -Force $ffBin = Get-ChildItem "$env:TEMP\ffmpeg_extract" -Recurse -Filter "ffmpeg.exe" | Select-Object -First 1 Copy-Item $ffBin.FullName "$InstallDir\bin\ffmpeg.exe" $fpBin = Get-ChildItem "$env:TEMP\ffmpeg_extract" -Recurse -Filter "ffprobe.exe" | Select-Object -First 1 Copy-Item $fpBin.FullName "$InstallDir\bin\ffprobe.exe" & "$InstallDir\bin\ffmpeg.exe" -version ``` -------------------------------- ### Example Environment Variable Configuration Source: https://nandyalu.github.io/trailarr/getting-started/01-first-things/environment-variables An example demonstrating how to set multiple environment variables and volume mappings for the application. ```yaml environment: - TZ=America/Los_Angeles - PUID=1000 - PGID=1000 - APP_DATA_DIR=/data/trailarr volumes: - /var/appdata/trailarr:/data/trailarr ``` -------------------------------- ### Download and Install FFmpeg on macOS Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs FFmpeg and ffprobe binaries on macOS by downloading zip archives and extracting them to the installation directory. Verifies the installation. ```bash mkdir -p "$INSTALL_DIR/bin" # ffmpeg curl -L -o /tmp/ffmpeg.zip "https://evermeet.cx/ffmpeg/get/ffmpeg/zip" unzip -o /tmp/ffmpeg.zip -d "$INSTALL_DIR/bin/" # ffprobe curl -L -o /tmp/ffprobe.zip "https://evermeet.cx/ffmpeg/get/ffprobe/zip" unzip -o /tmp/ffprobe.zip -d "$INSTALL_DIR/bin/" chmod +x "$INSTALL_DIR/bin/ffmpeg" "$INSTALL_DIR/bin/ffprobe" "$INSTALL_DIR/bin/ffmpeg" -version ``` -------------------------------- ### NVIDIA GPU Hardware Acceleration Example (CUDA) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/hardware-acceleration Use this command to leverage NVIDIA GPUs for hardware-accelerated encoding with CUDA. Ensure the NVIDIA Container Toolkit is installed and configured. ```bash ffmpeg \ -hwaccel cuda \ -hwaccel_output_format cuda \ -i input.mkv \ -c:v h264_nvenc \ -preset fast \ -cq 22 \ -b:v 0 \ -c:a aac \ -b:a 128k \ output.mkv ``` -------------------------------- ### Install uv Package Manager Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs the `uv` package manager using a script. Use the appropriate command for your operating system. ```shell curl -LsSf https://astral.sh/uv/install.sh | sh ``` ```powershell irm https://astral.sh/uv/install.ps1 | iex ``` -------------------------------- ### Install uv on Windows (PowerShell) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Execute this PowerShell command to install the `uv` package manager on Windows. Remember to restart PowerShell after the installation is complete. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Install uv System-Wide Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs the `uv` executable system-wide, making it accessible in minimal shell environments like those used with `sudo -u`. ```shell sudo cp "$(which uv)" /usr/local/bin/uv sudo chmod +x /usr/local/bin/uv # now retry: sudo -u trailarr uv sync --no-cache-dir ``` -------------------------------- ### Install Trailarr on Windows (PowerShell) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Execute this command in an elevated PowerShell (Run as Administrator) to install Trailarr on Windows. This script automates the download, environment setup, and service creation. ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force irm https://raw.githubusercontent.com/nandyalu/trailarr/main/install.ps1 | iex ``` -------------------------------- ### Standalone App Volume Mapping Example (Linux) Source: https://nandyalu.github.io/trailarr/getting-started/01-first-things/radarr-sonarr-volumes Example of volume mapping for standalone applications on Linux, where the host path and container path are the same. ```bash /mnt/usr/media/movies/:/mnt/usr/media/movies/ ``` -------------------------------- ### Define Installation Directories (Linux) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Sets default installation, data, and log directories for Trailarr on Linux. ```shell INSTALL_DIR="/opt/trailarr" DATA_DIR="/var/lib/trailarr" LOG_DIR="/var/log/trailarr" ``` -------------------------------- ### Install Intel Media Driver (Fedora) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs the Intel media driver and libva on Fedora systems. This is necessary for Intel GPU hardware acceleration. ```bash sudo dnf install intel-media-driver libva ``` -------------------------------- ### Standalone App Volume Mapping Example (Windows) Source: https://nandyalu.github.io/trailarr/getting-started/01-first-things/radarr-sonarr-volumes Example of volume mapping for standalone applications on Windows, showing a Windows host path mapped to a container path. ```bash C:\Users\YourUser\Media\Movies\:/media/movies/ ``` -------------------------------- ### Install uv on Linux/macOS Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Use this command to install the `uv` package manager on Linux and macOS systems. After installation, restart your shell or source your shell configuration file. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install Intel Media Driver (Ubuntu/Debian) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs the Intel media driver and related libraries on Ubuntu or Debian. This enables hardware acceleration for Intel GPUs. ```bash sudo apt install intel-media-va-driver intel-media-va-driver-non-free libva-drm2 ``` -------------------------------- ### Install Intel Media Driver (Arch) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs the Intel media driver and libva on Arch Linux. This enables hardware acceleration for Intel graphics. ```bash sudo pacman -S intel-media-driver libva ``` -------------------------------- ### Define Installation Directories (Windows) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Sets default installation, data, and log directories for Trailarr on Windows using PowerShell variables. ```powershell $InstallDir = "C:\Program Files\Trailarr" $DataDir = "C:\ProgramData\Trailarr" $LogDir = "C:\ProgramData\Trailarr\logs" ``` -------------------------------- ### Define Installation Directories (macOS) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Sets default installation, data, and log directories for Trailarr on macOS. ```shell INSTALL_DIR="/usr/local/opt/trailarr" DATA_DIR="$HOME/.local/share/trailarr" LOG_DIR="$HOME/Library/Logs/trailarr" ``` -------------------------------- ### Install GPG Tools on Ubuntu Source: https://nandyalu.github.io/trailarr/references/contributing Install necessary GPG tools on an Ubuntu development machine. This includes gnupg2, gpg-agent, and pinentry-curses. ```bash sudo apt-get install gnupg2 gpg-agent pinentry-curses ``` -------------------------------- ### Install NVIDIA Driver (Arch) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs the NVIDIA driver on Arch Linux. This command installs the necessary package for NVIDIA graphics. ```bash sudo pacman -S nvidia ``` -------------------------------- ### Install Python Dependencies (Windows) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs Python dependencies for Trailarr's backend using `uv sync` on Windows. ```powershell cd "$InstallDir\backend" uv sync --no-cache-dir ``` -------------------------------- ### Install Trailarr on Linux/macOS Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Run this command to install Trailarr on Linux and macOS systems. The installer script handles downloading the latest release, setting up a Python environment, and configuring system services. ```bash curl -LsSf https://raw.githubusercontent.com/nandyalu/trailarr/main/install.sh | sudo sh ``` -------------------------------- ### Install FFmpeg using Homebrew on macOS Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs FFmpeg using Homebrew and provides instructions to set FFMPEG_PATH and FFPROBE_PATH in the .env file. ```bash brew install ffmpeg # Then set FFMPEG_PATH and FFPROBE_PATH in your .env to the brew paths: which ffmpeg # e.g. /opt/homebrew/bin/ffmpeg which ffprobe ``` -------------------------------- ### Windows Task Scheduler Setup Script Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Run this PowerShell script to register Trailarr with the Windows Task Scheduler. It ensures Trailarr starts automatically upon user login. ```powershell & "C:\Program Files\Trailarr\scripts\windows\setup-startup.ps1" ``` -------------------------------- ### Install NVIDIA Driver (Ubuntu/Debian) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs the NVIDIA driver on Ubuntu or Debian-based systems. Ensure you have the correct driver version for your hardware. ```bash sudo apt install nvidia-driver-535 ``` -------------------------------- ### Docker Run Volume Mapping Example Source: https://nandyalu.github.io/trailarr/getting-started/01-first-things/radarr-sonarr-volumes Examples of using the -v or --volume flags with docker run to map host directories to container directories for Radarr and Sonarr. ```bash docker run ... -v /path/on/your/host/movies:/media/movies ... radarr_image docker run ... -v /path/on/your/host/tv:/media/tv ... sonarr_image ``` -------------------------------- ### Install NVIDIA Driver (Fedora) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs the NVIDIA driver on Fedora systems using akmod-nvidia for kernel module compatibility. ```bash sudo dnf install akmod-nvidia ``` -------------------------------- ### Linux Manual Start Command Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Manually start Trailarr using uvicorn, suitable for cron jobs or direct terminal execution. Ensure to run as the 'trailarr' user. ```bash sudo -u trailarr env \ APP_DATA_DIR=/var/lib/trailarr \ PYTHONPATH=/opt/trailarr/backend \ /opt/trailarr/backend/.venv/bin/uvicorn main:trailarr_api --host 0.0.0.0 --port 7889 ``` -------------------------------- ### Install Intel GPU Drivers and VAAPI Support (Ubuntu/Debian) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/hardware-acceleration Installs necessary Intel GPU drivers and VAAPI support on Ubuntu/Debian systems. It also adds the user to the render and video groups for device access and verifies VAAPI functionality. ```bash sudo apt update sudo apt install intel-media-va-driver i965-va-driver vainfo # Add your user to render and video groups sudo usermod -a -G render,video $USER # Verify VAAPI functionality vainfo ``` -------------------------------- ### Docker Compose Volume Mapping Example Source: https://nandyalu.github.io/trailarr/getting-started/01-first-things/radarr-sonarr-volumes Example of volume mappings in a docker-compose.yml file for Radarr and Sonarr. Identify the host paths (e.g., /path/on/your/host/movies) which are needed for Trailarr configuration. ```yaml services: radarr: # ... other settings ... volumes: - /path/on/your/host/movies:/media/movies # <-- Radarr volume mapping - /path/on/your/host/radarr/config:/config # ... other settings ... sonarr: # ... other settings ... volumes: - /path/on/your/host/tv:/media/tv # <-- Sonarr volume mapping - /path/on/your/host/sonarr/config:/config # ... other settings ... ``` -------------------------------- ### Install Mesa VA Drivers (Fedora) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs Mesa VA drivers and libva on Fedora. This enables hardware acceleration for graphics cards using Mesa and VA-API. ```bash sudo dnf install mesa-va-drivers libva ``` -------------------------------- ### Windows Task Scheduler Start Task Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Command to start the Trailarr task immediately after it has been registered. ```powershell Start-ScheduledTask -TaskName "Trailarr" ``` -------------------------------- ### Install Python Dependencies (Linux/macOS with System User) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs Python dependencies for Trailarr's backend using `uv sync`. If a system user was created, this command is run as that user to ensure correct ownership of the virtual environment. ```shell cd "$INSTALL_DIR/backend" sudo -u trailarr uv sync --no-cache-dir ``` -------------------------------- ### Install Python Dependencies (Linux/macOS without System User) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs Python dependencies for Trailarr's backend using `uv sync` in the current user's environment. ```shell cd "$INSTALL_DIR/backend" uv sync --no-cache-dir ``` -------------------------------- ### Install Mesa VA Drivers (Ubuntu/Debian) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs Mesa VA drivers and libva-drm2 on Ubuntu or Debian. This is for systems using Mesa for graphics and VA-API. ```bash sudo apt install mesa-va-drivers libva-drm2 ``` -------------------------------- ### Install Mesa VA Drivers (Arch) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/baremetal Installs Mesa and libva packages on Arch Linux. This is required for VA-API hardware acceleration with Mesa drivers. ```bash sudo pacman -S mesa libva ``` -------------------------------- ### Get Settings Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves the current application settings. ```APIDOC ### Settings GET /api/v1/settings/ Get Settings ``` -------------------------------- ### Linux/macOS CLI Installation Script Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Installs the Trailarr CLI by creating a shell script and making it executable. This allows you to run 'trailarr' commands from your terminal. ```bash PYTHON="$INSTALL_DIR/backend/.venv/bin/python" CLI_SCRIPT="$INSTALL_DIR/scripts/cli/trailarr_cli.py" sudo tee /usr/local/bin/trailarr > /dev/null << EOF #!/bin/sh exec $PYTHON $CLI_SCRIPT "$@" EOF sudo chmod +x /usr/local/bin/trailarr trailarr status ``` -------------------------------- ### macOS Manual Start Command Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Manually start Trailarr using uvicorn, suitable for adding to shell startup files or cron. This command uses 'exec' to replace the current shell process. ```bash cd /usr/local/opt/trailarr/backend APP_DATA_DIR="$HOME/.local/share/trailarr" PYTHONPATH=/usr/local/opt/trailarr/backend \ exec .venv/bin/uvicorn main:trailarr_api --host 0.0.0.0 --port 7889 ``` -------------------------------- ### Install AMD GPU Drivers and VAAPI Support (Ubuntu/Debian) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/hardware-acceleration Installs necessary AMD GPU drivers and VAAPI support using Mesa drivers on Ubuntu/Debian systems. It also adds the user to the render and video groups for device access and verifies VAAPI functionality. ```bash sudo apt update sudo apt install mesa-va-drivers vainfo # Add your user to render and video groups sudo usermod -a -G render,video $USER # Verify VAAPI functionality vainfo ``` -------------------------------- ### Trailarr Configuration Path for TRaSH Guides Users Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/docker-compose If you use TRaSH Guides and have existing Radarr/Sonarr configurations, use this mapping for Trailarr's config to maintain consistency. ```yaml # USE THIS WITH TRAILARR volumes: - /docker/appdata/trailarr:/config ``` -------------------------------- ### Get Connections Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a list of all configured connections. ```APIDOC ### Connections GET /api/v1/connections/ Get Connections ``` -------------------------------- ### Get All Media Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a list of all media items. ```APIDOC ### Media GET /api/v1/media/all Get All Media ``` -------------------------------- ### Get All Tasks Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a list of all tasks. ```APIDOC GET /api/v1/tasks/ Get All Tasks ``` -------------------------------- ### Get Files Simple Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a simplified list of media files. ```APIDOC GET /api/v1/files/files_simple Get Files Simple ``` -------------------------------- ### Monitor Media Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Starts monitoring a specific media item. ```APIDOC POST /api/v1/media/{media_id}/monitor Monitor Media ``` -------------------------------- ### Example Profile Configuration Source: https://nandyalu.github.io/trailarr/user-guide/settings/profiles/settings/general Demonstrates how to configure two profiles to download trailers in different languages, controlling the order and whether monitoring continues after each download. ```plaintext Profile Name: Spanish Trailer Stop Monitoring: false Priority: 100 ------------------------------- Profile Name: English Trailer Stop Monitoring: true Priority: 0 (or any lower number than the Spanish Trailer profile) ``` -------------------------------- ### Intel/AMD GPU Hardware Acceleration Example (VAAPI) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/hardware-acceleration This command demonstrates hardware-accelerated encoding using Intel/AMD GPUs with VAAPI. Replace `[dynamic_device_path]` with the actual render device path (e.g., /dev/dri/renderD128). ```bash ffmpeg \ -hwaccel vaapi \ -hwaccel_device [dynamic_device_path] \ -vaapi_device [dynamic_device_path] \ -i input.mkv \ -vf format=nv12,hwupload \ -c:v h264_vaapi \ -qp 22 \ -b:v 0 \ -pix_fmt yuv420p \ -c:a aac \ -b:a 128k \ output.mkv ``` -------------------------------- ### Windows Volume Mapping Examples Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/docker-compose Demonstrates various ways to map Windows paths to Docker volumes for Trailarr. Choose the format that best suits your system configuration. ```yaml volumes: - C:\Users\nandyalu\Videos\Movies:/data/movies ``` ```yaml volumes: - C:\\Users\\nandyalu\\Videos\\Movies:/data/movies ``` ```yaml volumes: - /C/Users/nandyalu/Videos/Movies:/data/movies ``` -------------------------------- ### Add User to Render and Video Groups Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/hardware-acceleration Add the current host user to the 'render' and 'video' groups for optimal Intel/AMD GPU performance. ```bash # Add current user to render and video groups sudo usermod -a -G render,video $USER # Verify group membership (log out and back in if needed) groups ``` -------------------------------- ### Docker Compose Example with Same Path Mappings Source: https://nandyalu.github.io/trailarr/getting-started/03-setup/connections This Docker Compose configuration demonstrates setting up Radarr, Sonarr, and Trailarr with identical volume mappings for media directories. This is useful when the paths within the *Arr containers directly correspond to the paths accessible by Trailarr. ```yaml services: radarr: image: ghcr.io/hotio/radarr:latest # Other options here volumes: - /docker/appdata/radarr:/config - /data:/data # Other options here sonarr: image: ghcr.io/hotio/sonarr:latest # Other options here volumes: - /docker/appdata/sonarr:/config - /data:/data # Other options here trailarr: image: nandyalu/trailarr:latest # Other options here volumes: - /docker/appdata/trailarr:/config - /data:/data # Other options here ``` ```yaml services: radarr: image: ghcr.io/hotio/radarr:latest # Other options here volumes: - /docker/appdata/radarr:/config - /mnt/movies_disk/media/movies:/media/movies # Other options here sonarr: image: ghcr.io/hotio/sonarr:latest # Other options here volumes: - /docker/appdata/sonarr:/config - /mnt/series_disk/media/tv:/media/tv # Other options here trailarr: image: nandyalu/trailarr:latest # Other options here volumes: - /docker/appdata/trailarr:/config - /mnt/movies_disk/media/movies:/media/movies - /mnt/series_disk/media/tv:/media/tv # Other options here ``` -------------------------------- ### Run Database Migrations (Linux/macOS) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Apply database migrations using Alembic. Run as the 'trailarr' user to ensure proper file permissions. ```bash sudo -u trailarr env \ APP_DATA_DIR="$DATA_DIR" \ PYTHONPATH="$INSTALL_DIR/backend" \ "$INSTALL_DIR/backend/.venv/bin/alembic" -c "$INSTALL_DIR/backend/alembic.ini" upgrade head ``` ```bash cd "$INSTALL_DIR/backend" APP_DATA_DIR="$DATA_DIR" PYTHONPATH="$INSTALL_DIR/backend" .venv/bin/alembic upgrade head ``` -------------------------------- ### Run Database Migrations (Windows) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Apply database migrations using Alembic on Windows. Ensure environment variables are set correctly. ```powershell cd "$InstallDir\backend" $env:APP_DATA_DIR = $DataDir $env:PYTHONPATH = "$InstallDir\backend" & ".venv\Scripts\alembic.exe" upgrade head ``` -------------------------------- ### Create .env Configuration File on Linux Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Creates the .env configuration file on Linux, setting essential variables including application paths and timezone. Ensures correct ownership. ```bash sudo tee /var/lib/trailarr/.env > /dev/null << 'EOF' APP_VERSION="vX.Y.Z" APP_DATA_DIR=/var/lib/trailarr APP_PORT=7889 APP_MODE="Direct Linux" TZ=America/New_York FFMPEG_PATH=/opt/trailarr/bin/ffmpeg FFPROBE_PATH=/opt/trailarr/bin/ffprobe YTDLP_PATH=/opt/trailarr/backend/.venv/bin/yt-dlp PYTHON_EXECUTABLE=/opt/trailarr/backend/.venv/bin/python PYTHONPATH=/opt/trailarr/backend LOG_LEVEL=INFO MONITOR_INTERVAL=60 WAIT_FOR_MEDIA=true UPDATE_YTDLP=false EOF sudo chown trailarr:trailarr /var/lib/trailarr/.env ``` -------------------------------- ### Get All Jobs Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a list of all jobs. ```APIDOC GET /api/v1/jobs/ Get All Jobs ``` -------------------------------- ### Create Connection Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Creates a new connection to a media source. ```APIDOC POST /api/v1/connections/ Create Connection ``` -------------------------------- ### Configure GPG `gpg.conf` Source: https://nandyalu.github.io/trailarr/references/contributing Set the pinentry mode to loopback in `~/.gnupg/gpg.conf`. This is often required for non-interactive environments. ```ini pinentry-mode loopback ``` -------------------------------- ### Get Stats Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves statistics about the application. ```APIDOC GET /api/v1/settings/stats Get Stats ``` -------------------------------- ### Get Logs Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a list of logs. ```APIDOC GET /api/v1/logs/ Get Logs ``` -------------------------------- ### Get Events Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a list of all events. ```APIDOC ### Events GET /api/v1/events/ Get Events ``` -------------------------------- ### Configure Git for Signing Source: https://nandyalu.github.io/trailarr/references/contributing Configure Git globally to use your GPG key for signing commits and tags. This ensures all your commits are signed. ```bash git config --global user.signingkey D38DD074ABF2FB6B git config --global commit.gpgsign true git config --global tag.gpgsign true ``` -------------------------------- ### Create System User and Set Permissions (Linux) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Creates a dedicated system user for Trailarr and sets ownership for installation, data, and log directories. This is optional but recommended. ```shell sudo useradd -r -d "$INSTALL_DIR" -s /bin/false trailarr sudo chown -R trailarr:trailarr "$INSTALL_DIR" "$DATA_DIR" "$LOG_DIR" ``` -------------------------------- ### Get Task Configs Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves the configuration for all tasks. ```APIDOC GET /api/v1/task-configs/ Get Task Configs ``` -------------------------------- ### Create .env Configuration File on Windows Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Creates the .env configuration file on Windows, specifying application paths and other settings using PowerShell. ```powershell "@" APP_VERSION="vX.Y.Z" APP_DATA_DIR=C:\ProgramData\Trailarr APP_PORT=7889 APP_MODE="Direct Windows" TZ=America/New_York FFMPEG_PATH=C:\Program Files\Trailarr\bin\ffmpeg.exe FFPROBE_PATH=C:\Program Files\Trailarr\bin\ffprobe.exe YTDLP_PATH=C:\Program Files\Trailarr\backend\.venv\Scripts\yt-dlp.exe PYTHON_EXECUTABLE=C:\Program Files\Trailarr\backend\.venv\Scripts\python.exe PYTHONPATH=C:\Program Files\Trailarr\backend LOG_LEVEL=INFO MONITOR_INTERVAL=60 WAIT_FOR_MEDIA=true UPDATE_YTDLP=false "@" | Set-Content "$DataDir\.env" -Encoding UTF8 ``` -------------------------------- ### Run Trailarr Docker Compose Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/docker-compose Command to start the Trailarr Docker container after configuring the docker-compose.yml file. ```bash docker-compose up -d ``` -------------------------------- ### Get All Customfilters Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a list of all custom filters. ```APIDOC ### Custom Filters GET /api/v1/customfilters/ Get All Customfilters ``` -------------------------------- ### Test Application (Linux/macOS) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Run Trailarr directly using Uvicorn to test the installation. This allows for immediate verification before setting up a service. ```bash sudo -u trailarr env \ APP_DATA_DIR="$DATA_DIR" \ PYTHONPATH="$INSTALL_DIR/backend" \ "$INSTALL_DIR/backend/.venv/bin/uvicorn" main:trailarr_api --host 0.0.0.0 --port 7889 ``` ```bash cd "$INSTALL_DIR/backend" APP_DATA_DIR="$DATA_DIR" PYTHONPATH="$INSTALL_DIR/backend" .venv/bin/uvicorn main:trailarr_api --host 0.0.0.0 --port 7889 ``` -------------------------------- ### Get All Custom Filters Source: https://nandyalu.github.io/trailarr/references/api-docs/openapi.json Retrieves a list of all custom filters. ```APIDOC ## GET /api/v1/customfilters/ ### Description Retrieves a list of all custom filters. ### Method GET ### Endpoint /api/v1/customfilters/ ### Parameters #### Query Parameters - **trailarr_api_key** (string) - Optional - Your Trailarr API key. - **trailarr_session** (string) - Optional - Your Trailarr session token. ### Response #### Success Response (200) - **response** (array) - A list of custom filters. #### Error Response (401) - **response** (object) - API key is missing #### Error Response (422) - **response** (object) - Validation Error ``` -------------------------------- ### Test Application (Windows) Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Run Trailarr directly using Uvicorn on Windows. Verify the installation by accessing the application via the specified host and port. ```powershell cd "$InstallDir\backend" $env:APP_DATA_DIR = $DataDir $env:PYTHONPATH = "$InstallDir\backend" & ".venv\Scripts\uvicorn.exe" main:trailarr_api --host 0.0.0.0 --port 7889 ``` -------------------------------- ### Get All Trailer Profiles Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves a list of all trailer profiles. ```APIDOC ### Trailer Profiles GET /api/v1/trailerprofiles/ Get all trailer profiles ``` -------------------------------- ### Get Job Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves details for a specific job by its ID. ```APIDOC GET /api/v1/jobs/{job_id} Get Job ``` -------------------------------- ### Docker Run for Intel/AMD GPU Acceleration Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/hardware-acceleration This command-line Docker Run instruction enables hardware acceleration for Intel/AMD GPUs by mounting the /dev/dri device. ```bash docker run -d \ --name=trailarr \ -e TZ=America/New_York \ -e PUID=1000 \ -e PGID=1000 \ -p 7889:7889 \ --device /dev/dri \ -v :/config \ -v : \ -v : \ --restart unless-stopped \ nandyalu/trailarr:latest ``` -------------------------------- ### Get Task Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves details for a specific task by its ID. ```APIDOC GET /api/v1/tasks/{task_id} Get Task ``` -------------------------------- ### Create Trailer Profile Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Creates a new trailer profile. ```APIDOC POST /api/v1/trailerprofiles/ Create a new trailer profile ``` -------------------------------- ### Get Task Data Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves data related to tasks. ```APIDOC ### Tasks GET /api/v1/tasks-data Get Task Data ``` -------------------------------- ### Get Raw Logs Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves logs in raw format. ```APIDOC GET /api/v1/logs/raw Get Raw Logs ``` -------------------------------- ### Docker Compose Configuration for Trailarr Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/docker-compose This is the main `docker-compose.yml` file for setting up the Trailarr service. Adjust the environment variables and volume mappings to match your specific setup, including your timezone and the paths to your Radarr/Sonarr media folders. ```yaml services: trailarr: image: nandyalu/trailarr:latest container_name: trailarr environment: - TZ=America/New_York # Change to your timezone # Add any other environment variables as needed. volumes: - /path/to/your/trailarr/config:/config # For Trailarr's database and logs # Map your Radarr media folder(s) - /path/on/your/host/movies:/media/movies # Example: if Radarr uses /media/movies internally # Map your Sonarr media folder(s) - /path/on/your/host/tv:/media/tv # Example: if Sonarr uses /media/tv internally # Add more volume mappings if you have multiple Radarr/Sonarr instances # or if your media is split across different locations. # The path on the right (e.g., /media/movies, /media/tv) is how Trailarr will see these folders. # The path on the left is the actual path on your Docker host system. ports: - "7889:7889" # Or choose a different host port if 7889 is taken, leave the right side as is restart: unless-stopped # Optional: Add labels, network, and other configuration as needed ``` -------------------------------- ### Get Video Info Source: https://nandyalu.github.io/trailarr/references/api-docs/api-docs.html Retrieves information about video files. ```APIDOC GET /api/v1/files/video_info Get Video Info ``` -------------------------------- ### Create .env Configuration File on macOS Source: https://nandyalu.github.io/trailarr/getting-started/02-installation/self-install Creates the .env configuration file on macOS, dynamically setting the timezone and specifying application paths. ```bash cat > "$DATA_DIR/.env" << EOF APP_VERSION="vX.Y.Z" APP_DATA_DIR=$DATA_DIR APP_PORT=7889 APP_MODE="Direct macOS" TZ=$(readlink /etc/localtime | sed 's|.*/zoneinfo/||') FFMPEG_PATH=$INSTALL_DIR/bin/ffmpeg FFPROBE_PATH=$INSTALL_DIR/bin/ffprobe YTDLP_PATH=$INSTALL_DIR/backend/.venv/bin/yt-dlp PYTHON_EXECUTABLE=$INSTALL_DIR/backend/.venv/bin/python PYTHONPATH=$INSTALL_DIR/backend LOG_LEVEL=INFO MONITOR_INTERVAL=60 WAIT_FOR_MEDIA=true UPDATE_YTDLP=false EOF ```