sábado, 9 de febrero de 2008

ScRiPtToGeTyOuTuBeViDeOs

Write in the console:

gedit youtube.sh

Then paste this:

# $Id: youtube.sh 496 2008-01-09 11:20:35Z $
if [ "$#" != "1" ]; then
echo "Usage:"
echo " youtube.sh http://www.youtube.com/watch?v="
echo " or"
echo " youtube.sh "
echo
exit 64
fi
VID=$(echo "$1"|sed "s/.*v=\([^&]*\).*/\1/")
URL1="http://www.youtube.com/watch?v=$VID"
echo -n "Getting $URL1 ..."
PARAM="$(wget -q -O - "$URL1"|grep watch_fullscreen|cut -d '&' -f 3)"
echo " done."
URL2="http://www.youtube.com/get_video?video_id=$VID&$PARAM"
echo -n "Getting $URL2 ..."
URL3="$(wget -S "$URL2" 2>&1|sed -n /Location:/s/.*http:/http:/p)"
echo " done."
echo "Video address is $URL3"
exec wget -O "$VID.flv" "$URL3"

Save all the changes and return the console

chmod +x youtube.sh

For example download this:

./youtube.sh http://www.youtube.com/v/LXzmrGU7Phk&

No hay comentarios: