bash script to dl mp3 from youtube links

Quick one to Download mp3 from a list of youtube links.

Use case: was sent a playlist of songs in the form of a google doc with links to youtube videos.
Who wants to manually go through and play those? Or go through the crap of downloading and converting blah blah.
Here’s a short script to just pull all those down to your machine. You will need youtube-dl and ffmpeg

#! /bin/bash

LINKS=”$(< ~/Music/youtubelinks.txt)”

for LINK in $LINKS; do
youtube-dl –extract-audio –audio-format mp3 “$LINK”


This entry was posted in Tech. Bookmark the permalink.