#!/usr/bin/env bash set -e -o pipefail # Check if URL argument is provided before enabling set -u if [[ $# -eq 0 ]]; then echo "Usage: yt2srt " exit 1 fi set -u url="$1" # Fetch subtitles and process them yt-dlp -q --skip-download --write-auto-subs --sub-format ttml "$url"