Download youtube videos on Ubuntu using command line


youtube-dl is an open-source and light weight download manager for video and audio content from YouTube and many other video hosting websites.

To install it on Ubuntu, run following command –

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl

sudo chmod a+rx /usr/local/bin/youtube-dl

To download youtube playlist videos, run following command –

youtube-dl -cit -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' "https://www.youtube.com/playlist?list=ListId"

where ListId is the id of the youtube playlist.

To download youtube video, run following command –

youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' 'https://www.youtube.com/watch?v=VideoId'

where VideoId is the id of the video being downloaded.

References

https://youtube-dl.org/

https://en.wikipedia.org/wiki/Youtube-dl

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s