iPod to youPod
Before I forget, allow me to download the contents of my brain pertaining to sharing one's iPod via the www.
Here is an outline of the steps necessary.
1. Transfer iPod contents to computer
2. Rename files / clean up ID3 tags
3. Make artist directories
4. Set up Apache webserver
5. Install Apache module mod-musicindex
6. Install Icecast streaming server
Transfer iPod contents to computer. I did it like this:
-
# go to directory on iPod where music is stored
-
cd /media/ipod/iPod_Control/Music
-
# cp the contents of folders inside music directory to webroot/mp3
-
cp {F0,F1,F2,F3,F4}{0,1,2,3,4,5,6,7,8,9}/* /var/www/mp3
Rename files / clean up ID3 tags. I did it like this:
-
# debian's package management system; use your equivalent
-
sudo apt-get install mp3info mp3rename
-
# check your tags out
-
# set a var for mp3info cmd to print a tab separated list of title, artist,
-
# album and newline
-
mp3infocmd=`mp3info -print '%t\t%a\t%l\t\n'`
-
-
#**** Refer to this list and edit your ID3 tags - see man mp3info for details ****#
-
-
# find all mp3s (ignoring single quotes, newlines, etc.)
-
find /var/www/mp3 -name '*.mp3' -print0 | xargs -0 $mp3info
-
# rename according to your perfect tags
-
# set default filename scheme
-
mp3rename -s '%a&l&t'
-
# rename!
-
mp3rename /var/www/mp3
Make directories for artists for easier browsing.
-
#!/bin/bash
-
-
########################################
-
# mp3_sort.sh
-
# note: anyone is free to use this script as I am about to post it online
-
# it has no error checking, and will almost definitely break, so it is
-
# distributed with no implied merchantability or fitness for a specific
-
# purpose
-
########################################
-
srcDir=/var/www/mp3
-
destDir=/var/www/mp3/sorted
-
-
cd ${srcDir}
-
# disregard case
-
find ${srcDir} -type f -iname \*.mp3 | while read f; do
-
-
# get artist
-
ARTIST=`mp3info -p '%a' "${f}"`
-
-
# make sure artist tag defined
-
if [ "noart$ARTIST" = "noart" ]; then # ARTIST undefined
-
echo "some artist tag missing";
-
else
-
# destination exists?
-
if [ ! -d "${destDir}/${ARTIST}" ]; then
-
# no? then make it
-
mkdir "${destDir}/${ARTIST}" \
-
|| echo "cannot make dir \"${destDir}/${ARTIST}\"."\
-
>/dev/stderr
-
fi
-
# mv file to newly made directory
-
mv -f "${f}" "${destDir}/${ARTIST}"
-
case "$?" in
-
# 0) echo "\"${f}"\" -> \"${destDir}/${ARTIST}\";;
-
0) echo "a file was moved";;
-
*) echo "could not move \"${f}\".">/dev/stderr;;
-
esac
-
fi
-
done
-
exit 0
Set up Apache webserver.
See apache.org for details.
Install Apache module mod-musicindex
-
sudo apt-get install libapache2-mod-musicindex
-
# the REAMDE file has all the instructions on setting the Aliases to whatever
-
# directory your music files are in
Install IceCast2
-
sudo apt-get install icecast2
-
# listens on port 8000 by default; allow tcp through in your router or firewall
1 comment November 28th, 2006