Tuesday, 9 August 2016

Download Youtube Videos on Ubuntu [How to]


This short post describes how to download Youtube videos, extracting audio from videos and downloading complete playlists with a single command.
There is a command line utility called youtube-dl that allows you to download videos from websites like Youtube, DailyMotion etc.

Installation:



You can use pip to install youtube-dl as:
sudo pip install -U youtube-dl


Usage:



=>To download a video, copy it's url from the address bar, open a terminal and type:
youtube-dl "<video_url>"

Example:
youtube-dl "https://www.youtube.com/watch?v=39LKPdirvcU"

(PS: It's a video of me playing guitar. Do watch it :D )
You can download videos from other websites too:
youtube-dl "http://www.dailymotion.com/video/x4nnzaw_best-photos-from-day-2-at-the-rio-olympics_sport"

=>To download a complete playlist, open the playlist and copy it's url. Then type:
youtube-dl --yes-playlist "<video_url>"

youtube-dl --yes-playlist "https://www.youtube.com/watch?v=oT1A1KKf0SI&list=PLxxA5z-8B2xk4szCgFmgonNcCboyNneMD"

=>To download audio from Youtube, type:
youtube-dl --extract-audio --audio-format mp3 "<video_url>"

Example:
youtube-dl --extract-audio --audio-format mp3 "https://www.youtube.com/watch?v=39LKPdirvcU"

That's it for now. More posts coming soon!

No comments:

Post a Comment