So Adobe decided to change the way it uses temp files in Flash for its newer 10.2r152 version in Linux. Before when you went to YouTube and watched a video it would temporarily put the video in your /tmp dir in the format /tmp/FlashXX*. It stayed there while you kept the webpage open. You could then copy the video from /tmp to wherever for your own use. Now the temp file is nowhere to be found. To take its place how about a shell oneliner to download a YouTube video from the command line?
Here's a oneliner bash script that uses wget, sed, awk, and tr to download a video from YouTube. Works on BSD, Linux, and Mac. Just put the code below in a file (I'll call mine ytd.sh) and make your file executable chmod +x ytd.sh.
#!/bin/bash ## Get Youtube Video using wget ## (compatible with Linux, BSD and OSX) # ## Two arguments # $1 Youtube URL # $2 You name for the video # wget -c --no-check-certificate --user-agent="" $1 -qO- | \ sed 's/\\u0026/\&/g'| \ awk '/fmt_url_map/{gsub(/[\|\"]/,"\n");print}' | \ sed -n "/^fmt_url_map/,/videoplayback/p" | \ sed -e :a -e '$q;N;2,$D;ba' | tr -d '\n' | \ sed -e "s/\(.*\),\(.\)\{1,3\}/\1/;s/\\\//g" | \ wget -c --no-check-certificate --user-agent="" -i - -O $2.flv
After putting in in a file and making it executable just go get your YouTube url and fire off the download. Here's an example.
./ytd.sh 'http://www.youtube.com/watch?v=J---aiyznGQ' keycat
This will make the file keycat.flv in your dir. Use a recent VLC or Mplayer to play the file.
Its very likely that this script will be out of date (broken) soon but hopefully it will be a good blueprint for anyone else in the future. Thanks to our friends at calomel.org for the fun code!