Quoted By:
The non-automated process I use works with Firefox, VLC and I recommend Audacity.
Go to about:config in firefox and set mediasource.enabled to false. This will limit your options to 360p and 720 usually, so it will limit the bitrate which includes audio fidelity.
Open your YouTube video, go to Right click -> Page info -> Media -> Sort by type -> get the video at the bottom, click the Save As... button.
Open VLC, choose File -> Convert/Save and set the profile to your desired output format and choose a file name. You should use FLAC because it's an open standard, and also it's lossless compressed.
Often the FLACs exported by VLC are broken so you can re-encode it to FLAC again with Audacity, and add metadata at the same time which VLC can read.
If you did enough digging you could make an ffmpeg command line that would automatically put the videos you download from firefox into your desired output format.