Page 3 of 7
Re: Write cover / album art images to MP3s - Win / Mac Python script
Posted: October 11th, 2008, 10:08 pm
by zakharm
pair of dimes wrote:
Thanks again, do you have any other features in mind?
You're welcome, I've had fun writing this and learning Python. Good little scripting language
I had started this script in Perl and it was impossible to make the script work on both the Mac and the PC. Python seems to have the cross platform thing pretty nailed.
I'm sure there will be some bug fixes, but I actually don't have any more features in mind. I'm very happy with the current feature set, but will definitely look at new requests.
Re: Write cover / album art images to MP3s - Win / Mac Python script
Posted: October 12th, 2008, 6:31 am
by madlan
Hi, I have a question and small request - would it be possible to have an option to save the album art as a folder.jpg in the same folder as the mp3 files rather than embed?
How does the script handle albums with more than 1 CD??
Great script!
madlan.
Re: Write cover / album art images to MP3s - Win / Mac Python script
Posted: October 12th, 2008, 9:16 am
by zakharm
madlan wrote:
Hi, I have a question and small request - would it be possible to have an option to save the album art as a folder.jpg in the same folder as the mp3 files rather than embed?
Good point, I can add another flag so that it doesn't embed. In the mean time you can do this:
- on line 80 add a check for a new flag: EMBED_ART
from:
if awsresult != "error" and os.path.isfile(IMAGE):
to:
if awsresult != "error" and os.path.isfile(IMAGE) and waa_conf.EMBED_ART:
- in waa_conf.py change / add the following to:
IMAGEFILE = "folder.jpg"
REMOVE_imagefile = False
EMBED_ART = False (new entry)
How does the script handle albums with more than 1 CD??
I haven't tried too many examples, but if the album name is the same across both CDs it should be fine. PM me any examples that don't work. A good indicator is to search on Amazon and see what it returns.
Re: Write cover / album art images to MP3s - Win / Mac Python script
Posted: October 19th, 2008, 12:59 pm
by madlan
Another small suggestion: Rename the actual file names based on the ID3 tag data?
eg: Track Number - Track Title.mp3 (01 - Silence.mp3) This could be configurable with switches, (%N% - %T%) etc
Just a thought!
Re: Write cover / album art images to MP3s - Win / Mac Python script
Posted: October 19th, 2008, 4:19 pm
by zakharm
madlan wrote:
Another small suggestion: Rename the actual file names based on the ID3 tag data?
eg: Track Number - Track Title.mp3 (01 - Silence.mp3) This could be configurable with switches, (%N% - %T%) etc
Yeah, this is definitely something I've been thinking of doing. Also, another thing I'm going to do is set a "move to" directory flag to move the files to another location when finished processing.
I don't have a time frame for these two features though!
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail
Posted: October 31st, 2008, 1:09 pm
by zakharm
Updated to v0.4 - 10/31/08
Write Album Art is a python script that embeds cover / album art into MP3s downloaded from SABnzbd. Embedding cover art into the ID3 tag is my preferred way of getting cover art to display on all the devices / software that I use to play music (iPod, iTunes, MediaMonkey, XBMC / Plex).
Major changes
* Windows executable now available, Python not required for Windows *NEW*
* Configuration now in ini file: waa_conf.ini - (to support Win32 exe) *NEW*
* Move and rename files feature *NEW*
Features
* Fetch and store album art into MP3 within SABnzbd
* Add MP3s to iTunes
* Remove extra files (.sfv, .nfo, .m3u)
* Fill in empty ID3 tags from Newzbin title, including empty track numbers
* Nested directory structure - Music/Artist/Album
* Soundtrack support
* Remove comments from ID3 tag
* Update XBMC / Plex library
* Move file to new directory after processing *new*
* Rename files to "01 - title.mp3" or "01 - artist - title.mp3" *new*
Requirements, install details and script / exe download are here:
http://kins.net/wordpress/2008/09/27/sa ... s-to-mp3s/
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail
Posted: November 1st, 2008, 2:17 pm
by zakharm
I've updated the download and here is the immediate fix:
Line 268
From:
conf = LoadConfig("waa_conf.ini", _ConfigDefault)
To:
conf_path = os.path.join(sys.path[0], "waa_conf.ini")
conf = LoadConfig(conf_path, _ConfigDefault)
If you wanted to change your ini path you would do it here too.
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail
Posted: December 4th, 2008, 1:45 pm
by bigdaddyo811
Can someone help me with this...I really want this to work. I get the following error:
External processing by /users/MCM/Library/Scripts/write_album_art.py:
Traceback (most recent call last):
File "/users/MCM/Library/Scripts/write_album_art.py", line 24, in
import sys, os, fnmatch, re, urllib, eyeD3, shutil, string, ConfigParser
ImportError: No module named eyeD3
thanks
bdo
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail
Posted: December 4th, 2008, 5:34 pm
by zakharm
Do you have the eyeD3 folder inside: /users/MCM/Library/Scripts/ ?
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail
Posted: December 9th, 2008, 7:43 am
by auskento
Just been trying this on my Ubuntu box.
This is awesome
2 minor issues I have discovered in a short amount of use so far.
1) If you get content that isnt mp3, it deletes the source folder
If you grab something via newzbin that is tagged 'music' and you have this script as the default for 'music' anything non-mp3 gets removed.
ISO, Mpg etc, the whole source folder is removed at completion of this script.
2) I use a squeezecenter to playback music to various points of the house. When the new files are deposited by this script, they are inaccessible due to the file permissions.
The resultant files seem to require +r and +x permissions for squeeze center to function.
Both of these issues are readily bypassed.
1) remembering to change the category
2) running another script to reset the permissions.
Just thought i'd mention them.
I am loving what this script is able to do.
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now av
Posted: March 19th, 2009, 3:48 pm
by Stitch
Would like to try this out, however the download has expired. Can anyone help?
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail
Posted: March 19th, 2009, 3:53 pm
by zakharm
The link still works for me in the first post.
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail
Posted: August 26th, 2009, 4:18 pm
by saintgosu
So I recently stumbled upon this script and set it up on OSX but kept running into an error that stated "The request must contain the parameter Signature." when the script would try to fetch album art from Amazon. The problem is that since August 15th, all requests to the Amazon API/AWS have to be cryptographically signed using your aws key. There are two options to handle this- the first is to rewrite part of the code to handle the api signing through a crypto package which is probably the 'best' solution.
The second method is what I did as I just wanted it to work and didn't want to implement signing in the code, so I used the site "
http://apisigning.com" which offers free api signing for AWS for up to several thousand requests a day. For this bootleg solution, first sign up for an account with
http://apisigning.com/ , get the email confirmation and set up your account with your AWS key/id.
Now, in the write_album_art.py code, make the following changes-
Line 189: change: awsurl = "
http://ecs.amazonaws.com/onca/xml" to awsurl = "
http://free.apisigning.com/onca/xml"
Line 223: change: "SubscriptionId": conf["art.amazon_aws_id"], to "AWSAccessKeyId": conf["art.amazon_aws_id"],
Line 220: delete "Version": "2005-03-23", (note sure if this really matters)
I think that's all I changed in the script. Not tested with windows/exe/whatnot. Love the script zakharm!
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail
Posted: August 26th, 2009, 4:27 pm
by zakharm
saintgosu,
great find and informative post on how to fix this. i'll have to look into both options and release an appropriate update.
i guess i should read those AWS emails they send me
Z
Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now av
Posted: September 25th, 2009, 9:34 pm
by zakharm
pair of dimes wrote:
Could you just use iTunes to fetch album artwork now? Is AWS used for anything else?
trying to find my aws key again
iTunes now has a watch folder that you could send the files to and I believe iTunes would pick it up and get the album art.
I have the script working with the new aws API, but I can't get it to work with snow leopard's 2.6 version of python. I'll release the source and maybe someone can figure it out. The alternative is to use the method described above via
http://apisigning.com