youtube-dl to be already installed in you system and present in your path.
You can install it using
sudo apt-get install youtube-dl
brew install youtube-dl
Then just adding the following lines in your bashrc or zshrc file will enable you to download music from any youtube video, just by typing `dym https://www.youtube.com/watch?v=Z1Z6tww61DA`
alias dym='youtube-dl -f "bestaudio[ext=m4a]" --embed-thumbnail --add-metadata
You can play around and tweak the flags according to your needs.