This site is currently on indefinite hiatus. For fresh, new Linux & productivity content, head on over to nathanrhale.com/linux/ and subscribe to the Linux-only feed.

CLI Fun

Download Youtube Videos on Linux with Youtube-dl

March 29th, 2008 | 3 Comments

I recently had a need to download a video from Youtube, and it was just a frustrating process. Many of the Firefox extensions that claim to do that are rather half-baked (the best being VideoDownloader) and it was jut a bit of a hassle. Then I discovered youtube-dl, and nice shell script put together by Ricardo Garcia Gonzalez. It’s *very* easy to use. From the website:

Use youtube-dl followed by a video URL or identifier. Example: youtube-dl “http://www.youtube.com/watch?v=foobar”. The video will be saved to the file foobar.flv in that example.

Keep in mind that the video is saved in its original flash (.flv) video format, so you’ll need a player that support .flv or you’ll need to convert it to another format.

EDIT: Check out this link to Linux.com on converting your YouTube videos to DivX or XviD.

Happy downloading!

Youtube-dl

Share and Enjoy:
  • Digg
  • del.icio.us
  • Furl
  • NewsVine
  • Slashdot
  • StumbleUpon
  • Technorati
  • Facebook
  • TwitThis
  • YahooMyWeb

3 Responses to “Download Youtube Videos on Linux with Youtube-dl”

  1. There’s now a graphical tool that uses this software. It allows to store in a preferred video directory, many formats to choose from (avi, mp4, mpeg, wmv, flv), and resolution of the video.

    Find it here:
    http://yourtubedownloader.awardspace.com/

    I would appreciate feedback via the forums or email.

    Thanks !

  2. Did not work. Complains of Java incompatibility. Help appreciated.
    Thanks

    Exception in thread “main” java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    at java.awt.Font.tk(libgcj.so.70)
    at java.awt.Font.getPeerFromToolkit(libgcj.so.70)
    at java.awt.Font.(libgcj.so.70)
    at javax.swing.plaf.FontUIResource.(libgcj.so.70)
    at javax.swing.plaf.metal.DefaultMetalTheme.(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at javax.swing.plaf.metal.MetalLookAndFeel.createDefaultTheme(libgcj.so.70)
    at javax.swing.plaf.metal.MetalLookAndFeel.(libgcj.so.70)
    at javax.swing.UIManager.(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at Run.(YourTube.java:25)
    at YourTube.main(YourTube.java:66)
    Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: cannot open shared object file: No such file or directory
    at java.lang.Runtime._load(libgcj.so.70)
    at java.lang.Runtime.loadLibrary(libgcj.so.70)
    at java.lang.System.loadLibrary(libgcj.so.70)
    at gnu.java.awt.peer.gtk.GtkToolkit.(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at java.lang.Class.forName(libgcj.so.70)
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    …13 more

  3. OK, you need to check that you have libgcj* packages installed.

    In Ubuntu Hardy they are:
    libgcj-bc
    libgcj-common
    libgcj8-1
    libgcj8-l-awt
    libgcj8-l-jar

    You will find these in Synaptic package manager.

    I have recently released a new version of this software, so give it a go and let me know by email how you get on.

    Thanks!