Audios de instantsfun.es en mp3

¿Te gustaría tener los sonidos de instantsfun.es en tu lista de reproducción?
Este script para bash extraerá todos los mp3 de instantsfun.es automáticamente y los guardará en un directorio llamado collection. Solo necesitas tener instalado: * wget * swftools
Implementación
#!/usr/bin/env bash
# (c) 2010 – Felipe Astroza – felipe(at)astroza.cl
# Under GPLv2, see LICENSE
SOURCE_HOST=http://instantsfun.es/swf
function prepare() {
WGET=$(which wget);
if [ $? != 0 ]; then echo “Please install \”wget\””; exit 1; fi
SWFEXTRACT=$(which swfextract);
if [ $? != 0 ]; then echo “Please install \”swftools\””; exit 1; fi
mkdir -p tmp collection
}
function cleanup() { rm -fr tmp; }
function get_swf_list() { echo $(cat $1 | grep swf | awk ‘BEGIN {FS=”\”“}; {print $6}’);}
function get_index() { wget -q $1 -O tmp/index; echo “tmp/index”; }
prepare
echo “InstantsFunGet – (C) 2010 Felipe Astroza”
echo -n -e “Reading index\r”
SWFLIST=$(get_swf_list $(get_index $SOURCE_HOST))
TOTAL=$(echo $SWFLIST|wc -w); cur=1
for swf in $SWFLIST; do
name=$(echo $swf | awk ‘BEGIN {FS=”.”}; {print $1}’)
echo -e -n ”\r[$cur of $TOTAL]\e[0K $name”
$WGET -q $SOURCE_HOST/$swf -O tmp/$swf
sound_id=$($SWFEXTRACT tmp/$swf|grep Sound:|awk ‘{print $5}’)
$SWFEXTRACT -s $sound_id tmp/$swf -o collection/$name.mp3
cur=$(($cur+1))
done
cleanup
# Under GPLv2, see LICENSE
SOURCE_HOST=http://instantsfun.es/swf
function prepare() {
WGET=$(which wget);
if [ $? != 0 ]; then echo “Please install \”wget\””; exit 1; fi
SWFEXTRACT=$(which swfextract);
if [ $? != 0 ]; then echo “Please install \”swftools\””; exit 1; fi
mkdir -p tmp collection
}
function cleanup() { rm -fr tmp; }
function get_swf_list() { echo $(cat $1 | grep swf | awk ‘BEGIN {FS=”\”“}; {print $6}’);}
function get_index() { wget -q $1 -O tmp/index; echo “tmp/index”; }
prepare
echo “InstantsFunGet – (C) 2010 Felipe Astroza”
echo -n -e “Reading index\r”
SWFLIST=$(get_swf_list $(get_index $SOURCE_HOST))
TOTAL=$(echo $SWFLIST|wc -w); cur=1
for swf in $SWFLIST; do
name=$(echo $swf | awk ‘BEGIN {FS=”.”}; {print $1}’)
echo -e -n ”\r[$cur of $TOTAL]\e[0K $name”
$WGET -q $SOURCE_HOST/$swf -O tmp/$swf
sound_id=$($SWFEXTRACT tmp/$swf|grep Sound:|awk ‘{print $5}’)
$SWFEXTRACT -s $sound_id tmp/$swf -o collection/$name.mp3
cur=$(($cur+1))
done
cleanup
Trabajos derivados
Me alegra saber que ya hay dos trabajos derivados: