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

Soumendra kumar sahoo
·Jan 17, 2021·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

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

Impressum

Views are my own and not represent of my employer.
All articles and images are CC-BY-SA-4.0 licensed unless or until explicitly specified.