Download youtube video directly from the command line with youtube-dl

2010-05-03 366 words 2 mins read

If you keep searching for applications to <a class="zem_slink freebase/en/uploading_and_downloading" title="Uploading and downloading" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uploading_and_downloading">download the <a class="zem_slink freebase/en/youtube" title="YouTube" rel="homepage" href="http://www.youtube.com/">youtube videos or you keep searching for the firefox addons to download the embedded the video, then this is for you. Ofcouse that is the case, only if you do not want to copy it after you have watched it in the <a class="zem_slink freebase/en/web_browser" title="Web browser" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_browser">browser :). If you have already watched it then you can copy it from the <a class="zem_slink freebase/en/mozilla_firefox" title="Firefox" rel="homepage" href="http://www.mozilla.com/en-US/firefox/">Firefox cache. I will post on that later for now lets see youtube-dl.

Lets download it first:

<a class="zem_slink freebase/en/sudo" title="Sudo" rel="homepage" href="http://www.sudo.ws/">sudo yum install youtube-dl

Now when you want to download a video then all you need to do is

youtube-dl <a class="zem_slink freebase/en/uniform_resource_locator" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL

This will work only if you can watch without logging in to your account, if you need to <a class="zem_slink freebase/guid/9202a8c04000641f80000000055d5879" title="Login" rel="wikipedia" href="http://en.wikipedia.org/wiki/Login">login then you should provide your <a class="zem_slink freebase/en/user" title="User (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/User_%28computing%29">username and <a class="zem_slink freebase/en/password" title="Password" rel="wikipedia" href="http://en.wikipedia.org/wiki/Password">password, like so:

youtube-dl -u username -p password URL

The problem with this is that the file will be saved with not so useful name. If you want to save the file with appropriate name then you can save the file with the title name:

youtube-dl -t URL

There are few other options worth looking at, specially :

-f FMT, –format=FMT
video format code
-b, –best-quality  download the best quality video possible
-m, –mobile-version
alias for -f 17
-d, –high-def      alias for -f 22

If you have multiple url&#8217;s to download then place all the url&#8217;s in a file, and then use the command:

youtube-dl -a filename

Hope this is useful to you.<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://en.onsoftware.com/ask-onsoftware-downloading-hd-video-from-youtube/">Ask OnSoftware: Downloading HD video from YouTube (en.onsoftware.com) <li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2010/04/08/bulk-youtube-video-downloader-for-firefox/">Bulk Youtube Video Downloader For Firefox (ghacks.net) <li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2010/05/03/megavideo-time-limit-bypass/">Megavideo Time Limit Bypass (ghacks.net) <li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2010/04/13/convert-youtube-videos-to-mp3/">Convert Youtube Videos To MP3 (ghacks.net) <li class="zemanta-article-ul-li"><a href="http://adriansjournal.blogspot.com/2010/04/at-last-forgotten-youtube-video.html">At Last! The Forgotten YouTube Video Downloader. (adriansjournal.blogspot.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/e6774c25-e405-4636-8b59-68f2046b4476/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b80.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it