Saturday, November 20, 2010

Downloading all VimCasts.org videos

What is VimCasts.org?


Vimcasts publishes free screencasts about Vim, the text editor. Vim has been around in one form or another for over 20 years. The learning curve is famously difficult, but those who manage to climb it insist that nothing can match Vim's modal editing model for speed and efficiency.

Why download when you can watch online?

I don't know about you, but I prefer to watch my videos from my HD and not the internet.

How do I download?

You can do it the manual way by righ-clicking on the ogg or m4v links and selecting Save-As. As of 2010/11/20 you'll need to repeat this procedure 27 time.

I'm never been much of a fan of repetitive work (that's one of the reason I program), so I decided to bash it and came up with this one-liner.


for (( c=1; c<=27; c++ )); do file=$(curl -s http://media.vimcasts.org/videos/$c/ | grep m4v | sed 's/.*m4v\">\(.*m4v\)<\/a>.*/\1/g'); url=http://media.vimcasts.org/videos/$c/$file; echo $url; curl -C - -# -o "$c-$file" "$url"; done


If you decide to try it out make sure to replace the 27 in the for section of the command. Also, If you prefer the ogv version, just replace the three m4v's with ogv.

2 comments:

  1. KimatBoven CredUcl8/8/13 10:14 AM

    update this

    ReplyDelete
  2. Don't know what 'Guest' is on about or why (s)he's so curt, but this seems to work like a charm for me and I just wanted to say THANKS because now I'm fully stocked on vimcasts for my train journey in an hour's time and can get back to last-minute packing. You made my day. [-:

    ReplyDelete