-
-
Save jrgcubano/a6df7e8b5ece515bb2d6 to your computer and use it in GitHub Desktop.
Downloads specified youtube videos as songs given text file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ "$#" -eq 1 ] || { echo >&2 "Requires single text file (with youtube links on each line) name as argument."; exit 1; } | |
command -v youtube-dl >/dev/null 2>&1 || { echo >&2 "Install youtube-dl first."; exit 1; } | |
if [ ! -d "downloads" ]; then | |
mkdir downloads | |
fi | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
youtube-dl -x --audio-format mp3 $line -o './downloads/%(title)s.%(ext)s' | |
grep -v "$line" $1 > temp | |
mv temp $1 | |
done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment