Jump to content


Photo

Challenge: Rename mp3 Songs via ID3 Metadata


  • Please log in to reply
7 replies to this topic

#1 systems_glitch

systems_glitch

    Dangerous free thinker

  • Moderating Team
  • 1,644 posts
  • Gender:Male

Posted 25 April 2010 - 10:39 PM

I recently noticed that a section of my mp3 library had truncated DOS-style 8.3 filenames (example: songna~1.mp3) due to transport on a flash drive that had been formatted in FAT 16 (aside: why do manufacturers send them out like that?). The mp3s still have correct ID3 metadata though, so I can extract the actual name of the song from that. I thought it would make a neat programming challenge, so here it is:

Using ID3 metadata and the programming language of your choice, write an application that renames a file, specified as a command line arg, using the file's ID3 information.

#2 systems_glitch

systems_glitch

    Dangerous free thinker

  • Moderating Team
  • 1,644 posts
  • Gender:Male

Posted 26 April 2010 - 06:53 AM

Here's my solution, in Python:


Spoiler


Mine renames all of the files in a supplied directory as I found that more convenient.

Edited by systems_glitch, 26 April 2010 - 06:55 AM.


#3 simone

simone

    Will I break 10 posts?

  • Members
  • 6 posts
  • Country:
  • Gender:Male

Posted 26 April 2010 - 04:17 PM

Here's my solution, in Python:


Spoiler


Mine renames all of the files in a supplied directory as I found that more convenient.



if you don't want to re-invent the wheel take a look to http://www.mp3tag.de



#4 systems_glitch

systems_glitch

    Dangerous free thinker

  • Moderating Team
  • 1,644 posts
  • Gender:Male

Posted 26 April 2010 - 06:25 PM

if you don't want to re-invent the wheel take a look to http://www.mp3tag.de

The project was intended more as a fun exercise than something entirely practical...besides, I run Linux!

#5 PurpleJesus

PurpleJesus

    Dangerous free thinker

  • Members
  • 1,578 posts
  • Gender:Male
  • Location:800

Posted 28 April 2010 - 06:56 PM

if you don't want to re-invent the wheel take a look to http://www.mp3tag.de

The project was intended more as a fun exercise than something entirely practical...besides, I run Linux!


I think its an excellent exercise. File IO, string extraction, manipulation, and rewrite functions I see off the top of my head. These things I DO need practice with. You'll have to give me a few of weeks though.. I'm in the process of moving and need a computer table. The spirit is willing, but the flesh is unfunded.

#6 simone

simone

    Will I break 10 posts?

  • Members
  • 6 posts
  • Country:
  • Gender:Male

Posted 29 April 2010 - 07:52 PM

if you don't want to re-invent the wheel take a look to http://www.mp3tag.de

The project was intended more as a fun exercise than something entirely practical...besides, I run Linux!


sorry, i work on windows every day so i totally forgot that many people don't use it. I've never cared about digging in mp3, i'm a curios one so i'll give it a try...

#7 n3xg3n

n3xg3n

    "I Hack, therefore, I am"

  • Members
  • 960 posts
  • Country:
  • Gender:Male
  • Location:(703)

Posted 07 May 2010 - 07:44 PM

I'll have a go, but I haven't programmed in Ruby for a while so it might be a bit ugly. Comments and criticisms are welcomed. Haven't been here in a while, but what with the semester rolling to an end in a couple days I hope to be back in the community a lot more.

Spoiler


#8 heisenbug

heisenbug

    Gibson Hacker

  • Members
  • 79 posts
  • Country:
  • Gender:Male

Posted 06 February 2011 - 04:15 PM

In Perl
Spoiler





BinRev is hosted by the great people at Lunarpages!