#!/bin/sh

if [ "$#" -ne 2 ]
then
	echo "Usage: $0 <directory dst> <playlist url>"
	exit 1
fi

mkdir -p "$1" && cd "$1" && yt-dlp \
	-f bestaudio -o "%(title)s.opus" \
	--add-metadata \
	--parse-metadata "playlist_index:%(track_number)s" \
	--embed-thumbnail "$2" -x --audio-format opus

