It is possible to download just the audio from a Youtube video. This is very easy.
Use youtube-dl to view information about the Youtube video and find the m4a audio track.
4.4 Sat Dec 07 jason@Yog-Sothoth 0: $ youtube-dl -F https://www.youtube.com/watch?v=JWPe9uh7FWU [youtube] JWPe9uh7FWU: Downloading webpage [youtube] JWPe9uh7FWU: Downloading video info webpage [youtube] JWPe9uh7FWU: Downloading js player vflYr569U [youtube] JWPe9uh7FWU: Downloading js player vflYr569U [youtube] JWPe9uh7FWU: Downloading MPD manifest [info] Available formats for JWPe9uh7FWU: format code extension resolution note 139 m4a audio only DASH audio 51k , m4a_dash container, mp4a.40.5@ 48k (22050Hz) 140 m4a audio only DASH audio 129k , m4a_dash container, mp4a.40.2@128k (44100Hz) 251 webm audio only DASH audio 133k , webm_dash container, opus @160k (48000Hz) 134 mp4 364x360 DASH video 68k , mp4_dash container, avc1.4d4015, 12fps, video only 278 webm 146x144 DASH video 95k , webm_dash container, vp9, 12fps, video only 160 mp4 144x144 DASH video 108k , mp4_dash container, avc1.4d400b, 12fps, video only 135 mp4 484x480 DASH video 160k , mp4_dash container, avc1.4d4016, 12fps, video only 242 webm 242x240 DASH video 220k , webm_dash container, vp9, 12fps, video only 133 mp4 242x240 DASH video 242k , mp4_dash container, avc1.4d400c, 12fps, video only 243 webm 364x360 DASH video 405k , webm_dash container, vp9, 12fps, video only 244 webm 484x480 DASH video 752k , webm_dash container, vp9, 12fps, video only 18 mp4 364x360 medium 144k , avc1.42001E, mp4a.40.2@ 96k (44100Hz), 6.70MiB (best) |
Then, use this awesome trick to download just the audio using the script. This will automatically correct the audio file header and you have a nice audio file to play with an MP3 player like Audacious.
4.4 Sat Dec 07 jason@Yog-Sothoth 0: $ youtube-dl -f 140 https://www.youtube.com/watch?v=JWPe9uh7FWU [youtube] JWPe9uh7FWU: Downloading webpage [youtube] JWPe9uh7FWU: Downloading video info webpage [youtube] JWPe9uh7FWU: Downloading MPD manifest [dashsegments] Total fragments: 79 [download] Destination: Sephiroth - The Clock of Distant Dreams-JWPe9uh7FWU.m4a [download] 100% of 5.89MiB in 00:13 [ffmpeg] Correcting container in "Sephiroth - The Clock of Distant Dreams-JWPe9uh7FWU.m4a" |
This gave me an AAC format audio file with 126 kilobits per second bitrate. Very nice way to download audio.
1 thought on “How to download only the audio from a Youtube video.”