View previous topic :: View next topic |
Author |
Message |
puddpunk l33t
Joined: 20 Jul 2002 Posts: 681 Location: New Zealand
|
Posted: Thu May 01, 2003 7:23 am Post subject: Looking for MP3/Ogg sorter/filer thing :) |
|
|
Hi there,
I've got a lot (~400) ogg files, that are siting in a dir and I want them sorted into subdirs, and the tracks renamed.
e.g.
music/Artist/Album/TrackNumber - Artist - TrackName
music/311/SoundSystem/02 - 311 - Come Original.ogg
And at the moment they are sitting in the music dir like:
music/311 - Come Original.ogg
So all the information needed is in the Ogg track tags (I've made sure of it!). Now I could do it myself, but, I'm sure there must be a program that can do this? I've had a look at cantus, and that doesn't seem to quite fit the bill (can't create dirs based on ID3/Ogg tags).
Any help appreciated,
Thanks,
Chris. |
|
Back to top |
|
|
Zapp! Tux's lil' helper
Joined: 11 Oct 2002 Posts: 77 Location: Germany
|
Posted: Thu May 01, 2003 8:41 am Post subject: |
|
|
I don't know a program that would automatically create subdirs, but Easytag is very good in renaming lots of files.
You could use it to rename your files to something like this:
artist - album - tracknumber - track.ogg
Now it's easyer to move them in subdirs, manually. |
|
Back to top |
|
|
ghetto Guru
Joined: 10 Jul 2002 Posts: 369 Location: BC, Canada
|
Posted: Thu May 01, 2003 10:54 pm Post subject: |
|
|
...this is prolly not what your looking for..
but net-rhythmbox is good for viewing all of your music files with it has seperate windows for album, artis, title, etc etc..
Ive never heard of a program to sort and create dirs based on id3tags _________________ Blizzard you suck. |
|
Back to top |
|
|
puddpunk l33t
Joined: 20 Jul 2002 Posts: 681 Location: New Zealand
|
Posted: Fri May 02, 2003 12:26 am Post subject: |
|
|
Damn! Looks like i'll have to write one then
Python...Here I come! |
|
Back to top |
|
|
puddpunk l33t
Joined: 20 Jul 2002 Posts: 681 Location: New Zealand
|
Posted: Sat May 03, 2003 3:48 am Post subject: |
|
|
Well, I made good on my threat and made my own one. Hah! 20 minutes and 24 lines of code later, I've done it, and my .ogg's have never been tidier.
For other people who might need to use this, you need to:
Code: | # emerge pyogg pyvorbis |
Then take my program:
Code: | #!/usr/bin/python
import ogg.vorbis
import os
topdir = '/music/'
def isogg(file):
if file[-4:] == '.ogg':
return 1
else:
return 0
files = filter(isogg, os.listdir(topdir))
files.sort()
for file in files:
oggfile = ogg.vorbis.VorbisFile(topdir + '/' + file)
oggcomments = oggfile.comment().as_dict()
print 'Moving', topdir + '/' + file, "to", topdir + '/' + oggcomments['ARTIST'][0] + '/' \
+ oggcomments['ALBUM'][0] + '/' + file
try:
os.makedirs(topdir + '/' + oggcomments['ARTIST'][0] + '/' + oggcomments['ALBUM'][0])
except OSError:
pass
os.rename(topdir + '/' + file, topdir + '/' + oggcomments['ARTIST'][0] + '/' + \
oggcomments['ALBUM'][0] + '/' + file) |
and change the topdir variable so that it points to your base music directory. Also, if you want to change the format, it would take some minor hacking, nothing serious.
Any enhancements welcome (also perhaps minor feature requests) |
|
Back to top |
|
|
ghetto Guru
Joined: 10 Jul 2002 Posts: 369 Location: BC, Canada
|
Posted: Sat May 03, 2003 4:36 am Post subject: |
|
|
i bet that felt really good to scratch that itch good job!! _________________ Blizzard you suck. |
|
Back to top |
|
|
puddpunk l33t
Joined: 20 Jul 2002 Posts: 681 Location: New Zealand
|
Posted: Sat May 03, 2003 4:56 am Post subject: |
|
|
damn straight, nothing like killing a mosquito with a high-level language like python! |
|
Back to top |
|
|
|