download automático de todos os vídeos de qualquer evento em Confreaks.com

original: http://abhishekkr.wordpress.com/2012/11/28/a-bionic-auto-download-all-videos-of-any-event-at-confreaks-com/

Baixe automaticamente todos os vídeos menores de qualquer evento fornecido em Confreaks.com

para instalá-lo, execute

$ sudo curl -L -o /etc/profile.d/ddl-confreaks.sh https://gist.github.com/raw/4137843/e6c6c93ef1c4cbf4cb735de821b74fcec467c170/gistfile1.sh

ou copie e cole a função shell abaixo em seu arquivo shell-load-conf.

suponha que o evento resida em URL:
http://confreaks.com/events/rubyconf2012

e você só precisa correr

$ ddl-confreaks rubyconf2012 ~ / Downloads

e baixará todos os vídeos do Talk da Ruby Conference 2012 em seu diretório ~ / Downloads …

baixaria todos os pequenos vídeos encontrados em todas as palestras na página do evento
https://gist.github.com/abhishekkr/4137843#file-gistfile1-sh

# Usage Example: $ ddl-confreaks rubyconf2012 ~/Downloads/
# save it as /etc/profiles/ddl.confreaks.sh
##
## currently it checks for lowest resolution video mostly {640x360} and downloads it

function ddl-confreaks(){
if [ $# -ne 2 ];
then
echo
'Failed. Syntax: $> ddl-confreaks EVENT_NAME DOWNLOAD_PATH'
return
fi
event=$1
download_path
=$2
event_url
="http://confreaks.com/events/$event"
echo
'[*] Getting all talk urls from the Event Page'
talk_urls
=`curl -s $event_url | grep --color -A1 "title" | grep href | sed 's/.*href="/http://confreaks.com/' | sed 's/".*//'`
echo
'[*] Getting all MP4 Video URLs from the Talk Pages'
for lines in `echo $talk_urls | xargs -L1`;
do
xmp4_url
=`echo $lines | xargs curl -s | grep 'application/x-mp4' | tail -1 | sed 's/.*href="//' | sed 's/".*//'`
if [ ! -z $xmp4_url ];
then
echo
"Scanned: "$lines
mp4file
=`echo $xmp4_url | sed 's/.*///' | sed 's/?.*//'`
save_as
=$download_path"/"$mp4file
echo
"Downloading URL: "$xmp4_url
echo
"to "$save_as"....."
wget
-c -O $save_as $xmp4_url
fi
done
}