Posted: . At: 10:53 AM. This was 3 years ago. Post ID: 14780
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


A much better way to save audio from Youtube with youtube-dl.


Saving music from Youtube is fun. I am going to show how to save in good quality using youtube-dl by itself.

This command will do it in one go.

youtube-dl -f 140 https://www.youtube.com/watch?v=eb-2ljQDYFU --embed-thumbnail --extract-audio --audio-format mp3

This is the command in action. This gets the music in good quality and also saves the Youtube thumbnail as the album art.

┌─[jason@jason-desktop][~/Music/Youtube]
└──╼ $youtube-dl -f 140 https://www.youtube.com/watch?v=eb-2ljQDYFU --embed-thumbnail --extract-audio --audio-format mp3
[youtube] eb-2ljQDYFU: Downloading webpage
[youtube] eb-2ljQDYFU: Downloading js player c299662f
[youtube] eb-2ljQDYFU: Downloading js player c299662f
[youtube] eb-2ljQDYFU: Downloading thumbnail ...
[youtube] eb-2ljQDYFU: Writing thumbnail to: Eternal Eclipse - Twilight Huntress (feat. Merethe Soltvedt)-eb-2ljQDYFU.webp
[download] Destination: Eternal Eclipse - Twilight Huntress (feat. Merethe Soltvedt)-eb-2ljQDYFU.m4a
[download] 100% of 2.27MiB in 00:00
[ffmpeg] Correcting container in "Eternal Eclipse - Twilight Huntress (feat. Merethe Soltvedt)-eb-2ljQDYFU.m4a"
[ffmpeg] Destination: Eternal Eclipse - Twilight Huntress (feat. Merethe Soltvedt)-eb-2ljQDYFU.mp3
Deleting original file Eternal Eclipse - Twilight Huntress (feat. Merethe Soltvedt)-eb-2ljQDYFU.m4a (pass -k to keep)
[ffmpeg] Converting thumbnail "Eternal Eclipse - Twilight Huntress (feat. Merethe Soltvedt)-eb-2ljQDYFU.webp" to JPEG
[ffmpeg] Adding thumbnail to "Eternal Eclipse - Twilight Huntress (feat. Merethe Soltvedt)-eb-2ljQDYFU.mp3"

This works very well for downloading a song you like to listen to locally. I hope you find this useful. And this does not really require FFmpeg. This can be done on Windows as well. Just download youtube-dl and then use it to save music using this trick. The music saved this way was about 120 Kb/s. But the quality is fine.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.