youtube-dl syntax
Technically, youtube-dl performs an illegal action which is to download or potentially download copyrighted videos. However, if you own the video, and want to take a backup copy, it is useful to do this. I did not write the below, when I find the source I will credit it.
The general syntax is:
youtube-dl -x --audio-format mp3 --audio-quality 320K
youtube-dl will output in the current directory
To list available formats
youtube-dl --list-formats URL
To download an entire user/channel
youtube-dl -citw ytuser:<USER> or youtube-dl -citw URL
To download all videos on a playlist
youtube-dl -citw <PLAYLIST URL>
To download a YouTube video as an MP3
youtube-dl -x --audio-format mp3 --audio-quality 320K <VIDEO_URL>
To download best available video (mp4) and best available audio (m4a) and then merge them together
youtube-dl -citw -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]' <VIDEO_URL>
To set the output file title
youtube-dl SOURCEURL --restrict-filenames --output "%(uploader)s.%(ext)s"