Skip to content

Instantly share code, notes, and snippets.

@chrisedrego
Last active December 7, 2022 06:56
Show Gist options
  • Save chrisedrego/2282625df46c24f34f69f309e74f9438 to your computer and use it in GitHub Desktop.
Save chrisedrego/2282625df46c24f34f69f309e74f9438 to your computer and use it in GitHub Desktop.
# Download Youtube Downloader
# sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
# sudo chmod a+rx /usr/local/bin/youtube-dl
YOUTUBE_PLAYLIST="https://youtube.com/playlist?list=PLqBZS2UWMeUzEzrhL9psrfjm_YicL-OoT"
PLAYLIST_NAME="music"
mkdir -p ~/$PLAYLIST_NAME && cd ~/$PLAYLIST_NAME
youtube-dl --ignore-errors -x -f 'bestaudio[ext=m4a]' --yes-playlist $YOUTUBE_PLAYLIST
find . -name '*.m4a' -print0 | while read -d '' -r file; do
ffmpeg -i "$file" -n -acodec libmp3lame -ab 128k "${file%.m4a}.mp3" < /dev/null
done
@lokeshmandhare
Copy link

Amazing !!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment