dotfiles/scripts/playlist-dl

15 lines
387 B
Plaintext
Raw Permalink Normal View History

2022-07-29 19:13:15 +02:00
#!/usr/bin/env bash
set -x
echo "Looking up playlist name..."
2023-04-23 18:55:30 +02:00
pl_line=$(yt-dlp --flat-playlist "$1" | grep "\[download\] Downloading playlist: ")
2022-07-29 19:13:15 +02:00
pl_name=$(echo ${pl_line:33} | tr '/' ' ')
echo "Found playlist by name: $pl_name"
echo "Downloading it into directory: $pl_name"
mkdir "$pl_name"
cd "$pl_name"
2023-04-23 18:55:30 +02:00
yt-dlp --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" "$1"
2022-07-29 19:13:15 +02:00
cd ../