Monday, 20 August 2012

Youtube-dl: Download Videos from the Command Line

Try youtube-dl to download videos to hard drive and watch them later when not connected. It uses the MIT licence. Youtube-dl is a command line tool and thus has to be run from the terminal.
Enter youtube-dl, the -t switch, the username and password for your account, and then the URL of the resource you wish to download which you can get from your browser's location bar, like this:

youtube-dl -t -u username -p password http://www.youtube.com/watch?v=Y2S9rwyQkJE

The -t switch means use the title of the video we're downloading. Enter 'man youtube-dl' for more options.  The application also prints the size of the video and the estimated time it will take, the ETA, to the terminal. Wait for it to finish and enjoy.

5 comments:

  1. good post... as of one month ago, one could simply open firefox, open tamper data, go to the you tube video in question, then within tamper data look for the actual flv/mp4 file/url. still within tamper data, highlight the flv/mp4 url, then hit 'open in browser'.. the browser would then just download the video file to local disk.

    these days it looks like you tube sends videos in chunks.. not via byte-range requests but 1.7M chunks via an index file of sorts..... maybe they moved to html5 distribution instead of their usual flash progressive download streaming.. still looking..

    verified using wireshark..

    ReplyDelete
  2. Glad it is useful. I got sick of needing to use add-ons like VideoDownloader in Firefox and waiting for it to finish. I now use SeaMonkey, where I'm guessing these extensions would work too, but something standalone is nicer.

    ReplyDelete
  3. I keep getting "ERROR: unable to download video" whenever I try to download using this. It's odd considering the fact that this used to work.

    ReplyDelete
  4. I've used a few methods in FireFox and Icecat. I wasn't aware that there was a "VideoDownloader" (or is it VideoDownloadHelper?) for Firefox on Linux though.

    Anyway, FlashGot has always worked well for me (well, not always, but usually). I have it configured to use curl.

    But the most convenient of the tools using this approach are Greasemonkey with scripts like this: https://userscripts.org/scripts/show/62634

    That seems to be the fastest.

    The problems I see with youtube-dl are twofold:

    1.) Your example used HTTP, not SSL/TLS (https://), yet I'm supposed to send my uid/pwd over the wire in clear text?

    2.) Why must I provide my uid/pwd credentials? Won't it work w/o that?

    Thanks for bringing this to my attention though. It does seem to be a kewl tewl :)

    Kindest regards,

    Bradley D. Thornton
    http://NorthTech.US

    .

    ReplyDelete
  5. Hi Bradley, I see you've been all over my little blog -:), or some of it at least. Think I've seen your handle before, maybe on the Slackware newsgroup?

    There are several add-ons like that for Firefox, but the idea was to have a tool that does not rely on a browser, especially because a lot of people do not use FF any more.

    To respond to the points you raised, the other way around:

    2.) It does not seem to connect without that, part of demanding id is age verification. Which is of course utterly useless.

    1.) You're right, it does not seem to support https. A workaround would be to open a new account and use it just for this purpose,i.e. dowloading.

    Thanks!

    ReplyDelete

Please leave your comment here. Spam will be deleted.

Labels

12.04 LTS (1) 1280x1024 (2) 14.1 (1) absolute (3) accessibility (6) administration (2) afterstep (1) android (1) announcements (13) anonymity (5) anonymous (1) anonymous browsing (1) antiX (2) applications (1) arch (9) archbang (11) archone (1) authentication (1) backports (1) bash (2) bittorrent (2) bodhi (1) books (1) browsers (5) browsing (1) bsd (2) bug (2) bugs (3) calculate (1) centos (1) certification (1) chakra (2) chat (1) chatzilla (1) chromebook (1) chromium (2) click (1) commodore 64 (1) crunchbang (5) crux (1) ctkarch (1) debian (21) desktop (55) devuan (1) digital certificates (1) digital memories (1) distributions (72) documentaries (1) documentation (2) drivers (1) duo (1) e17 (1) encryption (3) enlightenment (1) events (1) exit nodes (1) fake (1) fallout (1) fallout 4 (1) fedora (6) firefox (3) flash (1) flush (1) fluxbox (6) fluxflux (1) FPS (2) free software (2) frugalware (1) FSF (1) fusion (1) fvwm (1) fvwm-crystal (1) games (10) gaming (9) gentoo (2) gnome (8) gnome shell (4) gnu/linux (4) google (2) google-chrome (3) graphics (1) grml (1) hangouts (1) hardcore punk (1) hardware (3) how-to (22) humor (2) icewm (3) init (2) init freedom (2) interview (1) introduction (1) jibbed (1) jwm (1) kanotix (2) kde (17) kde3 (2) kernel (6) knoppix (1) kongoni (2) kubuntu (1) LAS (1) libtorrent-rasterbar (1) linux (18) linux light (12) live (40) live medium (13) live system (7) liveslak (1) lxde (12) lxqt (1) mageia (1) mandriva (1) marine life (1) mate (1) media center (4) mepis (2) mint (2) mobile (2) movies (5) mozilla (3) music (1) netbook (2) networking (4) news (3) nvidia (1) open source (1) openbox (13) openSUSE (2) opinion (12) other (5) overclockix (1) packages (1) pclinuxos (2) perl (1) poll (2) porteus (3) privacy (5) privoxy (1) programming (1) proxy (2) puppy (3) qbittorrent (1) qt (1) quick look (10) ratpoison (1) red hat (6) relax (1) release (1) reviews (48) rhythmbox (1) RPG (2) sabayon (5) salix (15) scientific (7) screenshots (2) scripts (3) security (1) semplice (1) server (3) shell (1) shooter (4) siduction (1) slackel (1) slackware (50) slackware 14.2 (1) slackware-current (10) slax (7) slitaz (1) smart phones (2) sms (1) south africa (2) specialist (1) spoof (1) surfing (1) systemd (2) table mountain (1) TDE (1) tegra k1 (1) themes (1) tinyme (1) tips (1) tor (3) torrenting (1) torrents (1) traffic analysis (2) trinity (2) trisquel (1) ubuntu (4) unity (2) unity linux (3) unix (1) upgrade (5) vector (2) video (3) vinux (2) virtualbsd (1) visual impairment (5) voip (1) vpn (1) wallpapers (3) window maker (4) window managers (1) wireless (10) xfce (13) youtube (1) zenwalk (3) zoo (1)

Linuxtoday.com