Obtain Solely Audio in MP3 Format With youtube-dl [Quick Tip]


youtube-dl is a flexible command line device for downloading movies from YouTube and lots of different web sites. I exploit it for making again up of my very own YouTube movies.

By default, you utilize youtube-dl for downloading movies. How about extracting solely the audio with youtubde-dl? That’s quite simple really. Let me present you the steps.

Downloading movies from web sites may very well be towards their insurance policies. It’s as much as you in the event you select to obtain movies or audio.

Obtain solely audio with youtube-dl

Please just be sure you have put in youtube-dl in your Linux distribution first.

sudo snap set up youtube-dl

When you solely need to obtain audio from a YouTube video, you should use the -x choice with youtube-dl. This extract-audio choice converts the video recordsdata to audio-only recordsdata.

youtube-dl -x video_URL

The file is saved in the identical listing from the place you ran the youtube-dl command.

Right here’s an instance the place I downloaded the voice-over of our Zorin OS 16 overview video.

youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ
[youtube] m_PmLG7HqbQ: Downloading webpage
[download] Vacation spot: Zorin OS 16 Evaluate - It is a Visible Masterpiece-m_PmLG7HqbQ.m4a
[download] 100% of 4.26MiB in 00:03
[ffmpeg] Correcting container in "Zorin OS 16 Evaluate - It is a Visible Masterpiece-m_PmLG7HqbQ.m4a"
[ffmpeg] Submit-process file Zorin OS 16 Evaluate - It is a Visible Masterpiece-m_PmLG7HqbQ.m4a exists, skipping

Did you discover the audio format? It’s in .m4a format. You could specify the audio format to one thing of your selection.

Say you need to extract the audio in MP3 format. You should use it like this:

youtube-dl -x --audio-format mp3 video_URL

Right here’s the identical instance I confirmed beforehand. You possibly can see that it makes use of ffmpeg to transform the m4a file into mp3.

youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=m_PmLG7HqbQ
[youtube] m_PmLG7HqbQ: Downloading webpage
[download] Zorin OS 16 Evaluate - It is a Visible Masterpiece-m_PmLG7HqbQ.m4a has already been downloaded
[download] 100% of 4.26MiB
[ffmpeg] Correcting container in "Zorin OS 16 Evaluate - It is a Visible Masterpiece-m_PmLG7HqbQ.m4a"
[ffmpeg] Vacation spot: Zorin OS 16 Evaluate - It is a Visible Masterpiece-m_PmLG7HqbQ.mp3
Deleting authentic file Zorin OS 16 Evaluate - It is a Visible Masterpiece-m_PmLG7HqbQ.m4a (move -k to maintain)

Obtain total YouTube playlist in MP3 format

Sure, you may completely try this. The principle factor is to get the URL of the playlist right here. It’s sometimes within the following format:

https://www.youtube.com/playlist?record=XXXXXXXXXXXXXXXXXXX

To get the URL of a playlist, click on on its title when the playlist is being displayed in the proper sidebar.

getting youtube playlist url
Click on on the playlist title

It is going to take you to the playlist web page and you may copy the URL right here.

youtube playlist url
Seize the playlist URL

Now that you’ve got the playlist URL, you should use it to obtain the audio recordsdata in MP3 format within the following vogue:

youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" playlist_URL

That scary wanting -o "%(title)s.%(ext)s" specifies the output file (with choice -o) and instructs it to make use of the title of the video and the extension (mp3 on this case) for naming the audio recordsdata.

downloading youtube playlist audio

I hope you discover this fast tip useful. Benefit from the audio recordsdata 🙂




Supply hyperlink