View previous topic :: View next topic |
Author |
Message |
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Mon Feb 20, 2006 11:43 pm Post subject: Media Library Manager |
|
|
MLM = MediaLibrary Manager
I've created a python app for managing my mp3s and oggs. Perhaps someone else can make use of it.
It has verified support for Mp3, Ogg and Flac at the moment... TagLib should support other formats as well, but I haven't tested them yet.
Features
- Supports Mp3, Ogg and Flac
- Capitalizing of words in title, artist and album tags
- Cleaning of comments (e.g. removing stupid comments like 'Ripped by Elite-H4xx0r' and the likes
- Checks to determine whether an album contains all tracks or not (determines whether it should be moved or not)
- Advanced macro-system for renaming files (see comments in config for further information)
ebuild
package
Installation instructions:
Python-TagLib
MLM depends on python-taglib, which depends on media-libs/taglib.
Then fetch python-taglib from here and unpack it.
Code: | cd python-taglib-1.3.3
./configure
make |
This will fail as it hasn't been updated to support recent versions of TagLib. This is a simple matter to change though. Just replace all occurences of FileTypeResolver (as a standalone word) with TagLib::FileRef::FileTypeResolver. (If you can come up with a nice script to do this and not fsck up the line SWIGTYPE_p_FileTypeResolver please tell me of it)
MLM
If you're using the ebuild:
Download the ebuild-package and unpack it in your overlay-directory.
Done
If not:
Download and unpack the package.
Code: | cd mlm-1.0
./setup.py install |
Usage
First off you should run
Code: | mlm --create-config |
This will create a default config in ~/.mlmrc. This is heavily documented and should explain every option available pretty well.
After you've edited ~/.mlmrc to satisfy your needs you run MLM with the directories containing the files that should be sorted as arguments.
Code: | mlm /foo/music/my_new_unsorted_mp3s /foo/music/my_new_unsorted_oggs /foo/music/my_new_unsorted_flacs |
MLM will then examine your files, fix your tags and then place them where they should be.
Hope you like it!
Last edited by Raniz on Sun Jun 11, 2006 2:11 pm; edited 1 time in total |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Wed Apr 12, 2006 3:25 pm Post subject: |
|
|
Hi,
I tried your program.
I think there is an error in the unwanted comments. could this be?
I also get an unicodedecodeerror. Is this because a file has a character that python can't progress? Could the encoding be wrong? And if this is some other problem can I bypass it then?
Could it be that the script removes id3v2 tags from mp3s?
I like your script and will use it to auto copy mounted usb stick with audio thanks, it was just what I was looking for and now I don't have to write it myself.
I like the system with the macro's very much.
good work! |
|
Back to top |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Wed Apr 12, 2006 3:52 pm Post subject: |
|
|
tmske wrote: | I tried your program.
I think there is an error in the unwanted comments. could this be? |
What error are you talking about?
Quote: | I also get an unicodedecodeerror. Is this because a file has a character that python can't progress? Could the encoding be wrong? And if this is some other problem can I bypass it then? |
Yes, i know about this, problem is I don't think I've gotten the hang of python and working with different encodings just yet.
Quote: | Could it be that the script removes id3v2 tags from mp3s? |
If you mean that you can't read the id3v2 tags with, for example, media-sound/id3v2 that's because TagLib writes id3v2.4 tags. Which id3v2 lacks support for. Applications that make use of TagLib (like amaroK) will be able to read them, I don't know how to force TagLib to write a lower version of id3v2 tags, but I'll look into that when I've got time.
Quote: | I like your script and will use it to auto copy mounted usb stick with audio thanks, it was just what I was looking for and now I don't have to write it myself.
I like the system with the macro's very much.
good work! |
Thanks, I haven't done anything to it for a couple of months now, but I'll probably try to fix the issues with unicode when I find the time for it. |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Thu Apr 13, 2006 7:53 am Post subject: |
|
|
I got an error that the reg exp of unwantedcomments was wrong, I didn't change anything to it so it must have been wrong in the beginning.
When I set onlywanted = true, it worked so it must be a wrong reg exp. |
|
Back to top |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Thu Apr 13, 2006 11:16 am Post subject: |
|
|
I seem to have fixed it here...
Replace UNWANTEDCOMMENTS in your .mlmrc with this (from my .mlmrc):
Code: | UNWANTEDCOMMENTS = ( r"(?i)[A-Z]:(\\.*)+", r"(/.*)+", r"(?i)(http|ftp)://.*", r"(?i)ripped\Wby", r"(?i)ripping" ) |
|
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Thu Apr 13, 2006 3:39 pm Post subject: |
|
|
Thanks,
for the encoding problem:
you can catch the error and do something, that way the program doesn't crach.
I have changed it so it doesn't crash.
I think I will make it write the name of the file so I can change that manually later. |
|
Back to top |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Sun Jun 11, 2006 2:13 pm Post subject: |
|
|
Version 1.1 is released. All unicode-related errors should be gone in this version. Works like a charm over here.
ebuild can be found here. |
|
Back to top |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Sun Jun 11, 2006 2:33 pm Post subject: |
|
|
Quick release of version 1.1.1 which actually includes a working default-config
ebuild is here. |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sun Jun 11, 2006 6:41 pm Post subject: |
|
|
thanks, will try it soon |
|
Back to top |
|
|
brackling n00b
Joined: 03 Jul 2006 Posts: 1
|
Posted: Mon Jul 03, 2006 8:15 pm Post subject: |
|
|
hey
i tested your script, but its resulting in writing files names to ./ and replacing all "/" within the path with "_" so files like
"_home_brackling_Radiohead-1993-Pablo Honey_12-Blow Out.mp3"
i dont know python, so i cant fix it myself.
any ideas?
my config
Code: |
VERBOSE = true
NEWNAME = "~/{ARTIST}{ALBUM}/{TRACK}{TITLE}.%e"
MACRO_ARTIST = ( "%a", "%a-" )
MACRO_ALBUM = ( "%y", "%y-%A", "%A" )
MACRO_YEAR = ( "%y", "%y-" )
MACRO_TRACK = ( "%N", "%N-" )
MACRO_TITLE = ( "%c", "%t (%c)", "%t" VARIOUSNAME = "~/music/Compilations/{YEAR}-{ALBUM/{TRACK}-{VARARTIST}-{TITLE}.%e"
MACRO_VARARTIST = ( "%a", "%a - " )
REQTAGS = ( "%a", "%A", "%t", "%N", "%y" )
CAPTAGS = false
LOWERCASE = ( "^be$", "^of$", "^at$", "^on$", "^as$", "^for$", "^and$", "^in$", "^is$" )
UPPERCASE = ( r"(?i)^m*(d?c{0,3}|c[dm])(l?x{0,3}|x[lc])(v?i{0,3}|i[vx])$", )
UNWANTEDCOMMENTS = ( r"(?i)[A-Z]:(\\.*)+",
r"(/.*)+",
r"(?i)(http|ftp)://.*",
r"(?i)ripped\Wby",
WANTEDCOMMENTS = ( r"(?i).*cover.*",
r"(?i).*originally.*",
r"(?i)(bonus|hidden)(\Wtrack)?",
r"(?i)(intro|outro)",
r"(?i).*version.*",
r"(?i)(re)?mix" )
r"(?i)ripping" )
ONLYWANTED = true
MUNGE = True
MMUNGE = ( ( "!", "" ), ( "?", "" ) )
RMUNGE = ( ( r"(?i)[^a-z0-9_. -]", "_" ), )
ALWAYSWRITE = true
|
|
|
Back to top |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Mon Jul 03, 2006 9:32 pm Post subject: |
|
|
ah, forgot to update the default config.
add a '/' between '.' and ' ' in RMUNGE |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|