解释YOUTUBE FLV 地址
http://kej.tw/flvretriever/
|
其他一种
當我看到這個Shell Script的時候,我在想 YouTube 的下載方式又多了一種
而寫這一個 Shell Script 的作者對 Script 及 YouTube 也很熟悉
我看了他的 Shell Script 原碼後,是利用 Linux 的 wget 下載 YouTube 的影片
其原始 Shell Script 碼如下:
#!/bin/sh
# $Id: youtube.sh 496 2006-06-05 23:37:35Z berto $
if [ "$#" != "1" ]; then
echo "YouTube Video Downloader"
echo "Written by Alberto Garcia <agarcia-at-igalia-com>"
echo "Homepage: http://people.igalia.com/berto/"
echo
echo "Usage:"
echo " youtube.sh http://www.youtube.com/watch?v=<video_ID>"
echo " or"
echo " youtube.sh <video_ID>"
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"
將上面的原始碼複製然後儲存為 youtube.sh
或由此下載