Thanks @JimmyHartington ! Great idea and macro!
I didn’t know youtube-dl existed. After having used dozens of websites and Chrome extensions to download YouTube videos, I think I finally found the ultimate tool. I adapted your macro to use it with Chrome and, as I regularly download MP3s from YouTube for my teen daughter, I created another macro with the following shell script:
export PATH=/usr/local/bin:$PATH; youtube-dl -x --embed-thumbnail --audio-format mp3 -o '~/Downloads/%(title)s.%(ext)s' $KMVAR_YoutubeLink
The macro will download an MP3 file with the YouTube embed thumbnail as cover art.
Thanks again!