Return to Snippet

Revision: 5169
at February 15, 2008 18:22 by Distrotest


Initial Code
#!/bin/bash

if [ $# -lt 1 ]; then
echo "Uso: $0 "
exit 1
fi

ID=`echo $1 | cut -d= -f2 | cut -d\& -f1`
FILE="youtube-${ID}"
BASE_URL="http://youtube.com/get_video.php"

wget -O /tmp/${FILE} $1

if [ $? == 0 ]; then
T_PARAM=`grep '&t=' /tmp/${FILE} | head -n 1 | awk -F'&t=' '{print $2}' | cut -d\& -f 1`
VIDEO_URL="${BASE_URL}?video_id=${ID}&t=${T_PARAM}"

wget -O ${FILE}.flv $VIDEO_URL

if [ $? != 0 ]; then
rm -f ${FILE}.flv
exit 1
else
echo "Formato (avi , mpg o wmv): "
read formato
ffmpeg -i ${FILE}.flv ${FILE}.$formato
fi
fi

rm -f /tmp/${FILE}

Initial URL

                                

Initial Description
Un programa en español que baja y convierte a varios formatos de video los videos de Youtube.

Initial Title
Downloader y conversor de videos de YouTube

Initial Tags

                                

Initial Language
Bash