It should be easy to export an iTunes list, but it's not.
April 19, 2020 6:44 PM   Subscribe

I know iTunes is not everyone's choice of music file managers, not even for Mac users, but I like it. I came up with it through the years and have the keyboard shortcuts ingrained, and I have come to like the way it presents my music in lists that I can arrange. What I've discovered I don't like is how hard it is to export the entire list of music.

I've taken some of my coronavirus stay-at-home time to throw myself into a project that's long overdue. I was in college the year Napster got big, so I've been sitting on 21 years of MP3s that I've kept with me from one computer to the next, accumulating without much organization. At last, I spent some time on it and I can proudly say that the job is done. Over 130,000 tracks, totaling 350+ days of music -- no duplicates. Metadata is correct and sorted, remixes are separate from originals, cover art is included wherever possible. I'm kinda proud.

What I would like to do next is to take this list out of iTunes, probably into a spreadsheet that I can filter and sort by multiple columns. And I don't have a workable way to do this. I at first tried to do it the obvious way, open iTunes and LibreOffice, go to my list, highlight all and press "Copy". The mouse pointer became a rainbow wheel for a while, but when it turned back into an arrow I moved to LibreOffice Calc and hit "Paste". The first time I tried this, LibreOffice crashed. The second time I tired this, my entire MacBook Air crashed. Not gonna try that again.

What I need:

-- To export my music list into a spreadsheet where there's a 1-to-1 correspondence with iTunes, meaning for every metadata in iTunes (Album, Sort Album, Album Artist, Sort Album Artist, Date Added, Date Modified, Bitrate, etc) there's a separate column on the sheet
-- For there to be a row for every single track -- again, over 130,000
-- To be able to filter the list by any of the column headers/metadata categories and search the list
-- To be able to edit the list so if I find that there's still some metadata in ITunes that needs fixing (GRRRR), I can also fix it on the spreadsheet

What I would also like:

-- Some way to also have the album covers visible, just once per album/LP/EP/etc., because I really put in work making sure I included as many album covers for some of my more obscure stuff, in as good picture quality as I could find

What I'm willing to do:

--Install scripts into iTunes
--Install a new program to export/manage if you can vouch for it
--Pay some money (a one-time purchase, not a subscription) if the program is good enough

What I don't want to do:

-- Upgrade to 10.15
-- Ditch iTunes as my main music program, unless you're recommending something that works on a Mac, can interface with an iPhone, and replicates the UI very closely

Computer specs: MacBook Air 11-inch, 2015. 1.6 GHz Intel Core i5, 4GB RAM, Mac OS X 10.14 Mojave

PS I specifically am using LibreOffice instead of Excel because the version of Excel on my computer has a row limit of 65,536, which I discovered when I saved my work one night and came back to find everything after that row was gone.
posted by The Pluto Gangsta to Computers & Internet (9 answers total) 2 users marked this as a favorite
 
Have you tried converting the XML file to CSV?

http://www.convertcsv.com/xml-to-csv.htm
posted by jeffmilner at 7:17 PM on April 19, 2020


I suspect you don't have enough RAM. I just tried the experiment of pasting 147150 lines out of iTunes into Excel (don't have LibreOffice) and it went in with no delays. But I have 48GB of RAM.
posted by a humble nudibranch at 7:20 PM on April 19, 2020


You can export your playlist to a text file and then bring that in to your spreadsheet. I just dragged my playlist.txt into Numbers and it worked perfectly.
posted by rodlymight at 7:21 PM on April 19, 2020


Along the same lines, searching Google for “itunes library xml parser” brings up quite a few results. Don’t have a specific recommendation though.
posted by doctord at 7:21 PM on April 19, 2020


Response by poster: jeffmilner: The website froze when I tried to upload the XML file, probably because it's 228MB.

rodlymight: Unfortunately that solution is for the new "Music" app that comes with Catalina. I could only export from iTunes as an XML file.
posted by The Pluto Gangsta at 11:59 AM on April 20, 2020


Best answer: A number of years ago I needed something like this on PC and found a thing to convert the library to a Microsoft SQL Server database. It worked perfectly, but obviously won’t work for you. Instead, I’ve found a Python program that claims to convert iTunes to SQLite, and even has examples of queries you can run. It may or may not be suitable, at least it might be a good way of occupying more time during lockdown.
posted by lhauser at 7:14 PM on April 20, 2020


Best answer: Admittedly I haven't had to do anything like this in a long time but the best source for iTunes scripts has historically been Doug's AppleScripts. Note that some of the most recent entries require Catalina/Music but if you scroll down you'll see prior versions for other OSes and iTunes. One of those might get you an export format that is tidy enough that LibreOffice can parse it.
posted by bcwinters at 4:06 PM on April 21, 2020


If you’re comfortable running a python script from the command line I can write one for you to convert the xml file to csv (I’m not sure if it’ll be possible to do anything with album artwork).

I am similarly obsessive about my music’s metadata and I’m still using iTunes (not Music). MeMail me if you’re interested and I’m happy to help!
posted by fabius at 1:37 AM on April 22, 2020


Response by poster: Thanks for pitching in, everyone! I wound up taking the problem to an college buddy of mine, and we agreed on a two-pronged approach:

1) I went through iTunes copy and pasting like before, but instead of doing it for my entire library, I set "Group Compilations" to OFF and went through it about one letter at a time. usually this came to about 10,000 entries each and was more manageable for me to cut-and-paste into the spreadsheet.

2) He used the instructions found here to import the library into R on his computer, which he told me took "7 gigs of RAM and 12 minutes to import the XML" and then outputted a CSV.

Surprisingly, we wound up with a different number of entries, because I hadn't expected that the Library XML I originally outputted would also include Movies, TV, audiobooks and other video files -- the newest OS X has these as separate apps and libraries, I think. Also, less of a surprise, the XML had a whole lot of fields of data that I hadn't considered using, even more than the columns of iTunes usually allows.
posted by The Pluto Gangsta at 10:26 AM on April 29, 2020


« Older recommend me your teleconferencing software   |   Exercises to improve cycling uphill Newer »
This thread is closed to new comments.