very cool... friend of mine, jolt, had the idea of using ngrep and curl to save itunes songs while you're playing them. much easier than my idea of trying to download and figure out apple's little itunes database. script only figures out mp3 songs in this version... but i modified it to download m4a and m4p songs as well... but those need to be renamed manually. i also changed it to use wget instead or curl, since wget doesn't kick you out of itunes like curl does.
#!/bin/sh
while [ 1 ]; do
mp3_name=`date +%y%m%d%M%S.mp3`
#mp3_packet=`ngrep -n 1 -q "mp3" port 3689`
mp3_packet=`ngrep -n 1 -q "(mp3|aac|m4a|m4p)" port 3689`
mp3_url=`echo $mp3_packet | grep GET | awk '{print $7}'`
mp3_host=`echo $mp3_packet | grep GET | awk '{print $4}'`
echo "host is $mp3_host"
echo "url is: $mp3_url"
echo "Retrieving $mp3_name"
#curl -o $mp3_name "http://${mp3_host}${mp3_url}"
wget -O $mp3_name "http://${mp3_host}${mp3_url}"
echo "Renameing according to id3 tags."
id3_name=`perl id3_name.pl $mp3_name`; code=$?
echo "code is $code"
if [ $code = 0 ]; then
echo "Renaming $mp3_name to ${id3_name}"
mv "$mp3_name" "$id3_name"
echo "Done."
else
echo "No ID3 tags found"
echo -n "Please enter the name of the song: "
read song_name
mv "$mp3_name" "$song_name".mp3
echo "Done."
fi
done
lol nevermind... found iLeech on sourceforge.net very cool to connect remotely to any iTunes, list all the songs, and download whatever you want. non-stop fun.
Posted by: skp on maio 16, 2003 09:16 AM