Idol season is surely upon us. And I have received many letters begging me to reveal how to make copies of YouTube videos. Ace and Taylor, whoever you are, you are greatly admired by a large segment of female America. For these folks and for anyone else who’s wondered how to archive YouTube video, here’s the answer. Follow this quick step-by-step process for retrieving YouTube content to display on your Mac or iPod.

  1. Read the YouTube.com Terms of Service. You may copy content for personal use so long as you do not (1) distribute it further (no torrentz, dudes) and (2) do not alter copyright notices. Here’s the relevant text:
    YouTube hereby grants you permission to use the Website as set forth in this Terms of Service, provided that: (i) your use of the Website as permitted is solely for your personal, noncommercial use; (ii) you will not copy or distribute any part of the Website in any medium without YouTube’s prior written authorization;…If you download or print a copy of the Content for personal use, you must retain all copyright and other proprietary notices contained therein. You agree not to circumvent, disable or otherwise interfere with security related features of the YouTube Website or features that prevent or restrict use or copying of any Content or enforce limitations on use of the YouTube Website or the Content therein.
  2. Find the YouTube Video ID. It’s the part of the URL after the “/v/” or “?v=” strings. For example, in the following URLs, the video id is nkp9OXAVD88. You’ll find this ID in the direct YouTube viewing page URL or, if embedded on another Webpage, in the Page Source. When viewing a page’s source HTML, search for www.youtube.com/v to find the URL.
    http://www.youtube.com/v/nkp9OXAVD88
    or
    http://www.youtube.com/watch?v=nkp9OXAVD88
  3. Plug the Video ID into a download URL. Use the following URL to retrieve the video for download. If you like, you can paste this URL directly into Safari. The file downloads to your desktop as “get_video”.
    http://youtube.com/get_video.php?l=165&video_id=PLACE_VIDEO_ID_HERE
    e.g.:
    http://youtube.com/get_video.php?l=165&video_id=nkp9OXAVD88
  4. Rename the Video. Give it a meaningful name and the add a flv extension. e.g. cowboys.flv, or whatever. Note the following OS X tip:
    To create a custom file/type association, start by selecting a file and choosing Get Info (Command-I). In this case, select your flv file. In the Get Info Window, under “Open With”, choose VLC and then click Change All. This creates the association that allows you to double-click an FLV file and open it in VLC.
  5. Watch it. VLC 0.8.1 plays FLV files directly or convert it to an iPod-friendly format with the fabulous donation-ware iSquint utility.

Obligatory AppleScript Solution

This script works with videos displayed directly at the YouTube site.

tell application "Safari"
	activate
	set baseURL to get URL of document 1
	set baseOffset to (offset of "?v=" in baseURL) + 3
	set urlLen to length of baseURL
	set fetchID to text baseOffset thru urlLen of baseURL
	set fetchURL to "http://youtube.com/get_video.php?l=165&video_id=" & fetchID
	set URL of document 1 to fetchURL
end tell