aboutsummaryrefslogtreecommitdiff
path: root/.scripts/audio_dl.sh
blob: bb41db640eb531b7bb7c506d9871ce7edcbde710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

FILE=$@
LINES=$(cat $FILE)

counter=1
for line in $LINES; do
  yt-dlp -x --audio-format mp3 "https://www.youtube.com/watch?v=$line" || echo "$line" >> "$FILE""_failed"
  counter=$((counter+1))
  tail -n "+$counter" "$FILE" > "$FILE""_remaining"
done
rm "$FILE""_remaining"