Download YouTube videos or only audios through this library

Download YouTube videos or only audios through this library

Open source youtube-dl library of Python

Subscribe to my newsletter and never miss my upcoming articles

Installation

$ brew install youtube-dl

Download videos

$ youtube-dl <youtube-link>

Download only audio

  • you need to install ffmpeg before trying this operation
$ brew install ffmpeg
$ youtube-dl -x --audio-format mp3 <youtube-link>

Example

$ youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=SlPhMPnQ58k
[youtube] SlPhMPnQ58k: Downloading webpage
[download] Destination: Maroon 5 - Memories (Official Video)-SlPhMPnQ58k.webm
[download] 100% of 3.11MiB in 00:09
[ffmpeg] Destination: Maroon 5 - Memories (Official Video)-SlPhMPnQ58k.mp3
Deleting original file Maroon 5 - Memories (Official Video)-SlPhMPnQ58k.webm (pass -k to keep)

Further reading

Photo by Szabo Viktor on Unsplash

 
Share this