views:

45

answers:

1

Ok, I've searched around here but haven't found anything pointing to a solid answer.

I'm trying to change a files artist, filename, rating, genre etc in windows, which shows up when you view folders in 'details'.

At the moment I have the files I wish to edit in a list and I am iterating through them, but as I said I am not sure how to change it for each file in the list.

def Files(The_FileList):
'''Changes each files metadata'''
for each_file in The_FileList:

    #clueless here.

return The_FileList

needs to work with .avi/.mkv general movie files as I do alot of encoding.

I'm looking for a simple option as this is all I want to do.

Thanks

+1  A: 

In many cases (and in this case), metadata is file-type specific. (Some filesystems offer their own metadata, as NTFS and later do, but this particular metadata is coming from the file itself, and not from the filesystem).

To modify the metadata in the files in question, you probably can use the Mutagen library (assuming these are mp3/aac/flac/vorbis/etc. - there are probably other audio formats that have a different metadata format).

Nick Bastin
would it work for .avi/.mkv/etc ?
code_by_night
http://pypi.python.org/pypi/hachoir-metadata/1.2.1 claims to handle both AVI and MKV, although I've never used it myself. You could also check out the Kaa project (http://doc.freevo.org/2.0/Kaa).
Nick Bastin
Have you used these before? Had havok getting hachoir to install, and then I have not been able to find documentation and have no idea how to even import the file.Then went to Kaa (for which most modules are only 70% complete) and have yet to find how to import it. Also its complaining about kaa.base being installed when I clearly did install it..Any ideas here?
code_by_night