[FPX]: Watching videos on YouTube [http://www.youtube.com/] or Google Video [http://video.google.com/] is fun. Sometimes, I want to keep them. You never know when they will be (re-)moved for whatever reason, and it's also nice to have the file available for offline viewing. For YouTube, there is youtube-dl [http://www.arrakis.es/~rggi3/youtube-dl/]. I could not find an equivalent utility for Google Video, so here's one. Please upgrade as necessary. Credit where credit is due: This code is based on the hints at [http://www.lifehack.org/articles/lifehack/how-to-download-google-video.html], and a lot of experimentation. Compared with Google's own "download" feature, this one does not require a Google-specific player. The files that you receive are in Flash Video format and can be played using, e.g., VideoLAN [http://www.videolan.org/]. More information about the Flash Video format is at http://en.wikipedia.org/wiki/FLV. ---- #! /bin/sh # the next line restarts using tclsh \ exec tclsh8.4 $0 "$@" package require http if {[llength $argv] != 1} { puts "usage: $argv0 " exit 0 } set url [lindex $argv 0] puts -nonewline "Downloading $url ..." flush stdout if {[catch {set urlToken [http::geturl $url]} oops]} { puts "$oops" exit 1 } if {[http::status $urlToken] ne "ok"} { puts [http::error $urlToken] http::cleanup $urlToken exit 1 } set urlData [http::data $urlToken] http::cleanup $urlToken puts "done." # # Looking for ...googleplayer.swf?&videoUrl\u003d[