https://www.jwz.org/hacks/youtubedown
Given a YouTube or Vimeo URL, downloads the underlying video file, with a sensible file name. It downloads the highest resolution version of the video available: first it tries HD MP4, then regular MP4, then WebM, and finally FLV. It also works on playlists, and works as a bookmarklet to download the video you're watching.
I liked it well enough.