Better iTunes song deduping

I’m happy to share my hacked version of Doug Adams Corral iTunes Dupes AppleScript. You can grab my version from here.

His version uses some wicked fast PERL to find all the duplicate songs based on info in the Library, and then puts them all in a Dupes playlist. However, I wanted to filter by Name, Artist, and Album, and have a single playlist where I could delete in one fell swoop all the duplicates. So I tweaked his AppleScript to have another prompt that asks if you want all dupes to go in the playlist, or just copies 2…X to go in.

I run it once with “All” to make sure I have what I want, and then rerun it with “Just Dupes” and build the playlist of files to delete. Works great, and I’m mailing him a copy, maybe it’ll be in the 1.1 version!

I was also very happy with the application Seek and Destroy Music Duplicates. It is written in Java using WebStart, and gave some good results as well. It is better in that you can pick which copy of the duplications you want to keep, and color codes each set of duplicates.

The tool iDupe really didn’t do that much for me, and the demo is limited to just doing 3 deletes. Seek and Destroy is a better choice.

45 Responses to “Better iTunes song deduping”

  1. nick Says:

    where can I get your de-duping script? the link is broken. sounds like it’s exactly what everyone needs

  2. Eric Says:

    I’ve updated the links in this blog post. Sorry about the confusion, this was caused by a revamp of our blog system and web site.

  3. kate Says:

    The script wants to run in Classic. Did I do something wrong?
    Also, the mac os x folder is empty … ?

  4. kate Says:

    Aha — tried something other than Stuffit — alles gut/

  5. Eric Says:

    Jim dropped me a note with this question:

    _After running your program, it creates the
    “dupes” playlist with all the dupes. Now that I have
    these in a playlist, is there anyway that I can
    actually have the dupes removed from the itunes
    library? When I select all in the dupes playlist and
    hit delete, it just deletes this playlist and i still
    have the dupes in my library._

    To actually delete the underlying files, you need to hold down the option (or is it control??) key. ITunes will ask you if you want to delete the actual files, and you click “Yes”. Drove me crazy for a while as well.

  6. ERIC Says:

    Excellent! Works perfectly, I had around 1600 duplicate files due to a transfer to a new computer, m3u files, and general forgetfulness. THE most important script I have on my computer.

  7. An excellent script for removing duplicate files from an iTunes library at JJB Blog Says:

    […] Finally I came accross this applescript, and it does precicely what I want. (and what I imagine everyone with this problem wants): finds duplicate songs according to user-specified metadata dimmensions, and put “all but one” of each file in a playlist. Select all, option delete, DONE. […]

  8. Dave Says:

    Do you have anything that will run on a pc?

  9. Kyle Says:

    Late to the party here but this is EXACTLY what I needed! Thank you.

  10. Craig Says:

    Ok so I’ve got the dupes playlist. How do I delete the FILES? not just the entires in the Library?
    Cheers
    c

  11. vin Says:

    To answer Craig’s: the best way i think is to add a comment to all songs in the dupe playlist (select all -> show info), then sort by that column and delete all the songs with that particular comment. Example: ‘ * ‘ as a comment.

  12. nillio Says:

    got 6000 duplicates, so this script is heaven 4 me!!! THANKS
    (ps: i just renamed all the artist names in the dupes list to ‘jsdhdgfsdjkjgvks’ and then deleted those in the library :)

  13. John Says:

    Nice contribution. I’m puzzled though, when you’ve expanded on someone else’s work (and indeed contributed a patch to them), why did you not allow access to your script inside the app? I would much rather have just downloaded the script than an app, or an app where I can get at the script. I want to see the code before I run it, and possibly tweak it for my own needs. I think I’ll just get Doug’s script.

  14. John Says:

    Ah, I see that Doug packaged the script in the same way, and that I can open these apps in the Script Editor. I’m new to Applescript - my bad, my apologies.

  15. links for 2008-01-06 | manicwave.com Says:

    […] OpenSource Connections » Blog Archive » Better iTunes song deduping nice deduper (or cover song finder!) (tags: itunes applescript) […]

  16. shivers Says:

    Totally amazing script, I found the best results where returned when I filtered the Dupes for ‘Size’ rather than name or albumn. That way you can make sure the ones that are the same size i.e. same song (regarless of albumn or name) are filtered into the Dupes playlist. Thanks to Jim for telling us how to delete tunes directly from a playlist.

  17. Keith Says:

    So, im currently running your script, its been going for 2 days now, i wish it didnt take so long, but i do have 330 gigs of music it is going through… I’m hoping it ends soon, cause i cant use itunes to put any new music on my iphone or ipods…. Is there a way to end the script and remove the duplicates its found so far… im afraid to force quit itunes and I dont see any other way to quit the script… thanks and if anybody knows how to do that, post a replyon here… also was wondering if anybody tried phelix, and how that compares to removing dupes versus this script… btw thaks a ton for putting in your fine work on this script…

  18. Clayton Says:

    Yeah - I believe the Size is the best attribute to sort by if you have an extensive collection (which I’m sure everyone does) and have 3 or 4 artists that play the same song name. Excellent Script!

  19. Chris Weiss Says:

    I’ve run into a rather frustrating problem that maybe this script can help fix. I’m re-ripping my library with Apple Lossless and have discovered that iTunes isn’t actually replacing the songs, but making duplicates. Would there be a way to tweak the script to automatically choose the lower bitrate (or at least smaller file) file for the duplicate? I’m sure I could figure it out with a week or two of studying, but if you’re a Perl wiz (and really, the mod should stay in your excellent script), you could probably knock it out in an hour, ya?

  20. christian_rennt Says:

    Months of looking for a solution have come to an end. Eric, this is the best thing that has happened to me in my MacLife so far. Cheers for that.

  21. Stijn Says:

    Thank you very much! This is exactly what i needed!

  22. Mike Says:

    Thanks!
    Saving me LOTS of time!
    In line with Keith’s comment, it would be great to have a cancel option while the script is running (versus force quit the script)

  23. Jerm Says:

    This looks compiled. iTunes does not recognize it as a script, nor does the script editor.
    unzip corral-itunes-dupes-eric.zip

    open in Script Editor:
    unzip corral-itunes-dupes-eric.zip
    ˛Ì˙Œ

  24. tommo Says:

    dude. you just saved me about 6 hours of mind numbing manual labour. thanks a million!

  25. prk Says:

    i have never used the scripts, so I have no clue how to use this… and i have million duplicates… please advise =)

  26. Glenn Says:

    I just got a Macbook and imported 18000+ songs onto it with iTunes. In my pc i had never found a good way to get rid of all the dupes. Now this is amazing. Thanks a million!!

  27. Andrew Says:

    Hi,

    This is a great tool! Not sure that I am using it correctly though? I have followed your instructions and have the dedupe folder populated, trouble is, it seems to have selected all of the songs. For example, where I have three songs, it moves all three to the dedupe folder, not just the duplicates? thus if I mass delete the folder I delete my entire itunes directory?

    can you please help?

  28. Fang Says:

    Hi,

    when I run this, it puts all songs into the dedupe list, not just the 3 or 3 dupes?

  29. mariko Says:

    can someone pleeease tell us challenged folk how to actually use it? i downloaded the script but don’t know what im doing after that.

  30. Peter Says:

    Eric
    As an owner of a new (second) ipod and a new PC, I am shocked by how CRAPPY iTunes is when it comes to migrating and synching music. Like everyone here, I now have an iPod with 60 GB - half of which are duplicated (more than 8,000 files). I Googled and found your killer script. Unfortunately I am enslaved on Windows Vista. Is there any Win version of your most valuable utility?

    It would be awesome if you gifted your script to Apple to make their core iTunes EXE more useful for serious music fans like us all. Any tips appreciated! Cheers, Peter

  31. Iwana Anderson Says:

    I am just another of those “your script rocks” posts. Maybe you could mention that one can delete the files from any playlist by pressing “Command(Alt?)” + “Delete”.

    I had to scroogle this first, but it works like a charm.

    Thank you for your contribution!

  32. ty Says:

    man, what an amazing tool. found 722 duplicates (3+GB on my laptop) very nice.

    for deleting the files, i just went into the “Dupes” playlist and Edit/Select All…Then held down CTRL-Option-Applekey and hit delete. I’m not sure which one does the trick, but using all 3 does it!

  33. Ruben Says:

    Hi,

    Make sure that the XML file path is without caracters like ‘ and > and < and such… Otherwise! Great! Idiots like me usually use paths like those…. hehehe so a warning would be great here!

    Ruben

  34. Chris Says:

    I need one that works for windows. Do you know of one.

  35. Détection des chansons en double… at Pomme Gyver Says:

    […] il vous faire quelques étape à la main. Commencez par télécharger le script Corral iTunes Dupes(Source). Décompressez le. Fermez iTunes (si celui-ci était lancé). Aller ensuite dans le dossier […]

  36. Artform Blog » Dedupe iTunes Playlists Says:

    […] Via OpenSource Connections […]

  37. Shawn Lesky Says:

    Need a windows alternative. I’m a Mac man but my music library is twice the size of the hard drive in my macbook pro. I have 11,000+ duplicates to get rid of (22,000+ when I show duplicates)

  38. amy Says:

    amazing. thank you a thousand times over for this script.

  39. Mim Says:

    Any version for PC, and Lovely Vista Sh…?
    thanks

  40. Mike Says:

    Hello All,

    Can someone describe how to install the files?

    Thanks a bunch!

  41. ben Says:

    i got phelix, ran it, have a folder with all the files now…so to create room do i just delete the phelix folder? sorry….comp ill.

    so now do i delete all the songs in itunes and make a new folder or what? help!

  42. Andrey Says:

    Thank you very much for this script! I’ve just bought a new mac recently and what I’ve found so far - the best community that makes and shares stuff! Keep up the good work. I think the 3-years lasting comments on this post just prove how good your script is!

  43. RD Says:

    Thanks! It worked perfectly!

  44. OmerCan Says:

    Great script enhancement. Congrats.

    Works flawlessly!!! :-)

  45. PunkyD Says:

    You rock!!!
    This is amazing!
    Thanks so much!

Leave a Reply