Download MP3 from a YouTube video (using the terminal)

Install the necessary tools with Brew. Run the following command:

brew install ffmpeg youtube-dl

Now, to download and convert to MP3, use the following command in the terminal. Replace the link with your YouTube video link:

youtube-dl --extract-audio --audio-format mp3 --prefer-ffmpeg "https://www.youtube.com/watch?v=6g1yM9SnwTw"

The terminal will display the download progress.

[youtube] 6g1yM9SnwTw: Downloading webpage
[youtube] 6g1yM9SnwTw: Downloading player 4fd50162
[download] Destination: Mariposas - Enanitos Verdes en M. Plaza de Toros Rodolfo Rodríguez “El Pana”, Tlaxcala Mayo, 31 2022-6g1yM9SnwTw.m4a
[download] 35.6% of 3.82MiB at 74.37KiB/s ETA 00:33

[ffmpeg] Destination: Mariposas - Enanitos Verdes en M. Plaza de Toros Rodolfo Rodríguez “El Pana”, Tlaxcala Mayo, 31 2022-6g1yM9SnwTw.mp3
Deleting original file Mariposas - Enanitos Verdes en M. Plaza de Toros Rodolfo Rodríguez “El Pana”, Tlaxcala Mayo, 31 2022-6g1yM9SnwTw.m4a (pass -k to keep)
(base) 

Once completed, you’ll have the MP3 file in your folder, it will remove the video file automatically.

Leave a Comment