Notes on seeking wisdom and crafting software

[Update] Download youtube videos in linux

I had posted long back about a bash wrapper over youtube-dl to fetch youtube videos using your own download manager. The youtube-dl script had changed long since then. And good news is now we don’t need to change the script in any way to get the download url. So here we go!

Grab the latest youtube-dl from [here](http://www.arrakis.es/~rggi3/youtube-dl/youtube-dl)

Minor update to the linux youtube-dl script:

#!/bin/bash

if [ $# -ne 2 ]

then

echo “Usage : $0 ”

echo “e.g : $0 http://www.youtube.com/watch?v=D1R-jKKp3NA steve_jobs”

else

outputfile=”.avi”

todnload=$(youtube-dl -g $1) # youtube-dl is in path, right?

echo “Got the file..”$todnload

axel -n 100 $todnload -o $2″.flv” # wget -c $todnload -O $2″.flv” .if you don’t use axel

echo “Download Completed…”

ffmpeg -i $2″.flv” $2$outputfile # get the avi file

fi

Enjoy :)

Thanks Jay for pointing this out!