tunes2html
tunes2html.pl is a Perl script that reads the data from an iPod's
iTunesDB file and generates an HTML file and a text file, each containing
an organized list of the songs and playlists on the iPod.
tunes2html.pl can be run using Perl or, on Windows, using the tunes2html executable.
The script should work on any platform that has Perl 5.005 or greater.
The script requires an iTunesDB file, which is readily available on Windows
and Linux systems to which an iPod has been connected. Access to the iTunesDB
file on Macintosh seems to be limited to Mac OS X.
tunes2html.pl has been tested on Windows 98, Windows 2000 Professional, Windows ME, Windows XP, Linux, Mac OS X, Solaris 5.7, and Solaris 5.8, using Perl 5.005 and Perl 6.
tunes2html works with iPod 3.x and iTunes 7.x & earlier versions of iPod/iTunes.
NOW AVAILABLE - tunes2html for iTunes!
tunes2html no longer confuses albums with the same name!
Download the latest version of tunes2html.
If you find tunes2html really useful, please consider using PayPal (safe and secure) to make a donation. Any size donation is really appreciated!
Update for v. 5.3
- Enabled reading of newer iTunesDB for iTunes 7.3
Update for v. 5.2
- Enabled reading of newer iTunesDB for iTunes 7.1
Update for v. 5.1
- Enabled reading of newer iTunesDB for iTunes 6.0 and above
Update for v. 5.0
- tunes2html now recognizes duplicate album names for different artists!
- Playlist songs can now list the albums from which they've come with the PlaylistAlbum option
Update for v. 4.0.2
- Fixed bug in database reading that would lead to "Out of memory" errors
- Fixed display problem that underlined playlist names
Update for v. 4.0.1
- Display problems fixed - no centering & albums are lined up properly.
Update for v. 4.0
- Works with iTunes 4.7 & iPod 3.0.
- Handles multi-disc albums.
- Many new options in tunes2html.cfg, including location of iTunesDB, name & type of output files, and web page colors. Click here for a sample.
- All configuration file options are also available as command-line options, which override configuration file settings, e.g. -ArtistColor or -HTMLFilename.
- -s option stops command-line output.
- Duplicates written to text file.
Update for v. 3.0
- Prints version number when argument -v is provided on command line.
- Configuration file tunes2html.cfg allows user to specify output type, page title, text and background colors, and use of composer in sorting. The configuration file must be called tunes2html.cfg and must be located in the same directory as tunes2html. Click here for a sample.
Update for v. 2.2
Update for v. 2.1
- Prompts user whether to use the Compser field for alphabetizing.
Update for v. 2.0
- Artists can be sorted by last name. Use the Composer field in the MP3 tag to define the artist's name for sorting purposes, e.g. Bragg, Billy for Billy Bragg. If the field is empty, tunes2html uses the Artist field.
- Reports songs that share track numbers and album titles, so duplicate album names and track numbering mistakes are easily discovered.
- Playlists can be read in either iPod 1.2 or iPod 1.3.
Update for v. 1.1
- Playlists are now listed.
Working on:
- Properly handle albums of the same name by different artists
- Handle 2-byte characters
tunes2html's output is visible in two sample files included in the bundle:
As you can see in the samples, there are three sections in the output -
"single artists" (one artist per CD), "various artists" (two or more
artists per CD), and "playlists".
The tunes2html ZIP file contains:
- tunes2html.pl - the Perl script
- tunes2html.cfg - the configuration file for tunes2html
- tunes2html.cfg.orig - a copy of the original configuration file for tunes2html for reference
- tunes2html.exe - a Windows-executable version of tunes2html - does not require Perl
- readme.htm - this page
- README.txt - a text version of this page
- COPYING.txt - the GNU General Public License
- sample.htm - a sample of the program's HTML output
- sample.txt - a sample of the program's text output
- minusbl.gif & plusbl.gif - graphics referred to in the HTML output
INSTRUCTIONS
Always use this script on a copy of the iTunesDB file!
0. Uncompress the ZIP file into a directory. (First use only.)
1. Connect an iPod to your computer.
2. Edit the configuration file to specify the location where you'll put the iTunesDB file and where you want the output files. The default is the directory in which you have
uncompressed the ZIP file.
3. Copy the iTunesDB file from the iPod_Control/iTunes directory (which
may be hidden) on your iPod to the directory that you specified. (See
copying instructions below.)
4a.Windows users: double-click tunes2html.exe.
4b.Perl users on any platform: run from command line as perl tunes2html.pl
5. Two files will be built: iPod.htm and iPod.txt. Both will be in the
location specified in the configuration file.
6. If there is a problem with file creation or reading the iTunesDB, the
program will print an error message.
How to get a copy of iTunesDB from your iPod:
Windows:
- Connect your iPod to your computer.
- Open Windows Explorer, making sure Explorer is set to "Show hidden files and folders".
- In Windows Explorer, go to the disk letter for the iPod.
- Open the folder called iPod_Control.
- In the iPod_Control folder will be a folder called iTunes. Open it.
- In the iTunes folder will be a file called iTunesDB.
- Right-click the iTunesDB file and choose Copy.
- Go to the directory in which you installed the script, right-click, and choose Paste.
Mac OS X:
- Connect your iPod to your computer.
- In the Finder, Go > Utilities to open the Utilities folder.
- In the Utilities folder, double-click Terminal.
- In the Terminal window, type each step then hit ENTER. When you do the "ls", look for the name of your iPod:
- cd /Volumes
- ls
- cd NAME OF YOUR iPOD
- cp iPod_Control/iTunes/iTunesDB ~/Desktop
- Move the file from the Desktop to the directory in which you installed the script.
Linux (assumes iPod is mounted to /mnt/ipod):
- Connect your iPod to your computer.
- Copy /mnt/ipod/iPod_Control/iTunes/iTunesDB to the directory in which you installed the script.
tunes2html.pl is based on tunes2pod.pl from GNUpod by Adrian Ulrich.
Updated versions of tunes2html will be available at http://www.joescafe.com/tunes2html.
This program and its components are distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
If you have any questions, comments, suggestions, or praise, please e-mail me at jmmallon at joescafe dot com.
Joe Mallon