#!/usr/bin/env bash # Load playlist file to variable path="/srv/dev-disk-by-uuid-622a8d60-4f8c-4de1-b821-40b6eb69a2e4/Media/podcasts" playlist_file=$(<$path/playlists.txt) echo "will download new episodes to $path" ls $path # Split into array of playlists readarray -t playlist_array <<<"$playlist_file" if [ "$(docker inspect podcast-downloader --format '{{.State.Status}}')" = "running" ]; then echo "the container is running, skipping new run..." exit 0 fi # itterate through playlists for playlist_def in "${playlist_array[@]}" do parts=($playlist_def) url=${parts[0]} filter=${parts[1]} # Run command to download # Windows version # ./bin/yt-dlp.exe -I $filter --config-location ./yt-dlp.conf $url # Docker version docker run \ -v $path/:/app: \ -w /app \ --rm \ --name podcast-downloader \ thr3a/yt-dlp \ --config-location \ ./yt-dlp.conf \ -I $filter \ $url done