I had to leave for Goa the other day and I was packing my bare essentials when I came across my age old forgotten iPod. Finding it out of blue was a bliss and I decided to take it along. I put it on charge and it was ready to rock.
I never realized what wonder old playlists can do. Listening to those old tracks I felt as if I was transported back to those good old carefree college days. After returning from Goa I decided to export those tracks to my computer, however there was an issue. We all know for some reason Apple renames music files and rearrange them in random folders. This makes it impossible to figure out which file corresponds which track.
Here take a look:
These are all random filenames. However to my relief these files were not encrypted and their ID3 tags were still intact. That meant all I needed to do was rename these files and I was good to go.
However given the size of my playlist (6.5 GB) there was no option to do this manually. So I wrote a little script that could help me out.
My script goes through these files, collecting their ID3 tags, maintaining a hash and finally copying these files over user provided destination to respective folders based on album name and the file itself is renamed on track title. Running the script restored back my playlist within 105 seconds. Here’s the benchmark:
0.160000 7.470000 7.630000 (105.228952)
And this is how my playlist looks now on my file system:
Here is the source code:
Feel free to star, fork, follow or contribute on GitHub. 🙂