Command for YouTube Music Downloads
I've been trying to make the perfect all in one command to download music in the best quality possible from YouTube. This command correctly gets and embeds Artist name, Album name, Song name, *release date*, **release year**, **square thumbnail**, and video description. It downloads the best quality audio (opus 48k [251], falls back to bestaudio if 251 doesn't exist) and converts it to flac for easy use with audio apps like DJ software (what I use this for).
Here it is:
``` yt-dlp -f 251/bestaudio -o "%(artist)s - %(title)s.%(ext)s" -x --audio-format flac --parse-metadata "description:(?s)(?P<meta_comment>.+)" --parse-metadata "description:(?s)(?P<meta_year>\b\d{4}\b)" --parse-metadata "description:(?s)(?P<meta_date>\d{4}-\d{2}-\d{2})" --embed-metadata --embed-thumbnail --convert-thumbnails jpg --ppa "ffmpeg: -c:v mjpeg -vf crop=\"'if(gt(ih,iw),iw,ih)':'if(gt(iw,ih),ih,iw)'\"" [YouTube Music Link Here] ```
Couple details: * The flac conversion does blow up the file size by like 7x, so most people probably want to remove the `--audio-format flac` portion. * This command expects songs from YouTube Music, as the video description contains proper release date info. * The release date and release year use regex to get dates in `yyyy-mm-dd` and `yyyy` format respectively.