Using Ubuntu to clean up my music library
October 23, 2013 2:27 PM   Subscribe

I have an ubuntu powered fileserver that I primarily use as a media server these days. There are many files on the machine that (for various reasons) I no longer have a license to play.* What is the best way to scan through all the songs in my library (about 30k) and filter out those that will not play given that they do not all have an exclusive filetype? *Example: a song that was bought by a roommate with a license shared through iTunes that is no longer shared.
posted by stuboo to Computers & Internet (9 answers total) 1 user marked this as a favorite
I'd start off with

find /wherever/dir/you/want/to/start/looking/* -name *.m4p

to see how many of those sorts of files there are.

If they all look like wonderful candidates for deletion, I'd use

rm `find /wherever/dir/you/want/to/start/looking/* -name *.m4p`

to do the dirty. You could also use the -exec flag in find to run rm instead of the backtick command substitution if that's more your style.
posted by oceanjesse at 3:58 PM on October 23, 2013

But first things first, find out exactly what file extensions you'll want to delete.
posted by oceanjesse at 4:01 PM on October 23, 2013

I use winamp to play music, and it doesn't care about where the mp3 originated.
posted by theora55 at 4:17 PM on October 23, 2013

oceanjesse, the question clearly specifies that the offending files are not all of the same type, and from the sound of it they don't even want to get rid of all files with DRM, only those that don't currently have licenses allowing them to be played. stuboo, what's your playback mechanism? Do you have iTunes running on one or more other machines with its library pointed at the fileserver, or is the fileserver itself running iTunes? Is everything on the same Apple ID? If you're gonna hang on to some of the DRM stuff you'll need to specify what constitutes a "valid license." I don't have high hopes that you will find an automatable way of doing this, but that would be the first step.
posted by contraption at 4:57 PM on October 23, 2013

Response by poster: Thanks for the replies, folks. contraption, you're exactly right. Some of the DRM files are mine and I don't want to get rid of them. Some of them aren't. I suppose I could just remove all files that have DRM and then re-download the files that I do have a valid license for. I stopped buying from itunes quite a while ago for this very reason, so I don't have a lot of files that would be affected. My playback mechanism is variable, ranging from playing off itunes (if I'm on my laptop), vlc in linux, and the built-in music play on the boxee box. Based on this discussion, I'll probably give a trial run at oceanjesse's solution using mv instead of rm to start. If I do that, I should be able to see which songs will play and move those manually back to the folder of "keepers." Thanks for helping me think about this "out loud."
posted by stuboo at 5:29 PM on October 23, 2013

The owner of the song should be in the file as an mp4 atom. There are many mp3/mp4/aac tagging programs, maybe one will display mp4 specific metadata.

Or else use a tool like atomic parsley to dump the info. And write a script to delete the ones that aren't yours.
posted by wongcorgi at 5:29 PM on October 23, 2013 [3 favorites]

Aren't m4p files different from mp4 files? I thought m4p files were the DRM versions.
posted by oceanjesse at 6:02 PM on October 23, 2013

Never mind, mp4 is a totally different format. But I thought Apple dropped the DRM at some point? I'm probably wrong about that.
posted by oceanjesse at 6:05 PM on October 23, 2013

In iTunes you can remove DRM from any of your own files by selecting the file and choosing "Create XXX Version" where XXX is the preferred file type chosen in iTunes preferences under "file import". Then delete the protected version, and keep the unprotected. If you select all protected music in iTunes (type="Protected AAC" or etc) and use this approach it should remove DRM from all files it can read, but won't touch the ones you don't have permission to use. At which point you should be able to safely kill all DRMed files, keeping the unprotected copies.
posted by caution live frogs at 5:42 AM on October 24, 2013 [1 favorite]

« Older How to ask for a raise?   |   Since I can't read that cassette... Newer »
This thread is closed to new comments.