Download the audio only
utlink='https://www.youtube.com/watch?v=bn9F19Hi1Lk'
- get all video and audio links for the video
youtube-dl -F "$utlink"
- pick the best mp4a audio only option (e.g. 140)
- get a download link
audio=$(youtube-dl -f 140 -g "$utlink")
- use audio download link in ffmpeg to download portion of the audio
- download first 5 mins of the audio
ffmpeg -i "$audio" -t 300 -c:a libmp3lame waves300.mp3
- download first 5 mins of the audio
Notes:
- ffmpeg has
ss
starting time option youtube-dl -f 22
gives a combined video and audio link- see https://unix.stackexchange.com/questions/230481/how-to-download-portion-of-video-with-youtube-dl-command