Page 4 of 7

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: October 3rd, 2009, 8:05 am
by c0ld
It would be nice if this script could correctly deal with image files that are already included with the NZB. At the moment it just ignores them, then trips up when it tries to delete the directory because it isn't empty. Only way round it is to set the removeimage flag to true, but then you lose both image files. How about if, before it checks amazon, it first checks the folder for image files matching a RE (*front*, *cover*, etc) then renames it to what is in the config file and uses it as the cover, then deletes the other images (back, cd etc) or maybe, moves them along with the mp3s when it cleans, copies, renames etc

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: October 4th, 2009, 6:23 am
by c0ld
The problem with that is that sab doesn't save in the correct manner, ie /artist/album. I could also get itunes to do the sorting, but it also ignores image files and trips up while trying to delete.

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: October 26th, 2009, 7:10 am
by nutski
I set this up on windows last night, its great and it cuts out a few steps in sorting, but just wondering if it is possible in the future to have a little more control over the folder and file naming?
My gf tagged all the music it is like this:

(Folder ) Artist/Rel Year - Album
(File) Artist - Album - Track No - Track Name

If in the future you could customise the naming then i could just set my final location for my ablums and let it go!

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 16th, 2010, 2:18 pm
by madlan
Does the windows exe work with the current version of SAB?
All I recieve in the script output is: "Request unsuccessful." (With no changes made to the files\tags)
Also, does the exe version not need the amazon dev key?

Thanks.

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 17th, 2010, 1:53 pm
by zakharm
I'm on 0.5 beta 6 and it just worked for me.

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 18th, 2010, 4:30 am
by madlan
Hi Zakharm, could you detail anything that may help? What options have you set in your config file etc?

Thanks.

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 18th, 2010, 9:20 am
by zakharm
Are you on the latest beta or still on 0.4.12?
Did you try the script on multiple downloads?  If you've only used it on one, try a second different one.

I've uploaded the INI to pastebin
http://pastebin.com/m6677ad8c

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 18th, 2010, 10:35 am
by madlan
Thanks for that, I've posted mine as a reference in reply to yours - I cannot see any difference that would cause it to fail though - strange.
Did you add an exception to the firewall for the app or something?

What do you get in the script log? I'm getting:

------------------------------------------------------------------------------------

SOMEARTIST - SOMEALBUM (2009)

          01-uncleantrackname.mp3 : ARTIST: Tiesto album: SOMEALBUM
Album art fetch from AMZN: SOMEARTIST SOMEALBUM
02-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
03-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
04-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
05-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
06-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
07-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
08-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
09-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
10-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
11-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
12-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
13-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
14-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
15-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
16-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM
17-uncleantrackname.mp3 : artist: SOMEARTIST album: SOMEALBUM

------------------------------------------------------------------------------------

It seems to be attempting to find the album using the album and artist names but not sure if its sucessful or not? (Its not renaming any files or pulling artwork down etc)

I'm also on 0.5 beta 6

Is your script closed source on win now it's a compiled exe?

Thanks for your help,
madlan.

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 18th, 2010, 10:44 am
by zakharm
It looks like it is firing off correctly, but you've disabled the embedding of art and you might not want to have the art that the scripts downloads as Folder.jpg as that might create a file conflict

YOUR ENTRY
[art]
imagefile = Folder.jpg
remove_imagefile = False
embed_art = False

CHANGE BACK TO
[art]
imagefile = album_cover.jpg
remove_imagefile = True  #this removes album_cover.jpg when done processing - stay away from Folder.jpg
embed_art = True


I'm not sure why your tracks wouldn't be renamed though.

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 18th, 2010, 12:19 pm
by madlan
Hi Zakharm, I wanted to create a folder.jpg rather than embed in each mp3, Windows media center picks up the folder.jpg and uses this rather than embedding.
Do you have to py script? I can run this directly and log some output that may help.

As a test I will try with the options you mentioned.

Thanks,
madlan.

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 19th, 2010, 7:52 am
by madlan
Problem solved,  I was running the script from the scripts folder, after reading our instructions again I see it needs to be in the sab root folder.

Thanks for helping me!

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now av

Posted: January 27th, 2010, 6:25 pm
by tafkaj
Hi,

thanks for all the work to provide this script - I would love to use it. Unfortunately I keep getting an error on OSX 10.6.2 with Sabnzbd+ 0.5.0 RC3:

Code: Select all

'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/Users/XXX/Downloads/SABScripts/write_album_art.py", line 24, in <module>
    import sys, os, fnmatch, re, urllib, eyeD3, shutil, string, ConfigParser
zipimport.ZipImportError: can't decompress data; zlib not available
Any idea what goes wrong?

TIA

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: January 27th, 2010, 10:23 pm
by zakharm
I've written many posts on these forums to figure this out and the only answer I've seen for the Mac is to upgrade you Python install.  Snow Leopard comes with Python 2.6, so I don't understand why you have to upgrade, but that is what I'm told.

Let me know if you upgrade your Python and it works!  (I haven't tried it yet)

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now avail

Posted: February 2nd, 2010, 11:10 am
by phischi
I allways get the error that the dir isn´t empty and can´t remove the dir.
But I set remove_mp3_after_itunes_add = "1" ???

anyone an idea??

thanks

Code: Select all

[art]
imagefile = album_cover.jpg
remove_imagefile = True
embed_art = True

[id3]
fetch_missing_id3_newzbin = True
set_empty_track = True
remove_comments = True

[itunes]
# Windows users running Python from source requires install of pywin32: http://sourceforge.net/project/showfiles.php?group_id=78018
add_to_itunes = True 
add_to_itunes_even_on_cover_fail = True
# WARNING! Only turn the following flags on if iTunes is set to "Copy file to iTunes Music folder when adding to library" in Preferences > Advanced
# 0 = NO or 1 = YES - does not remove folder
remove_mp3_after_itunes_add = "1" 
remove_dir_after_itunes_add = True

[files]
#Removes original "ARTIST - ALBUM (YEAR)" folder and makes: [MUSIC Root]\[ARTIST]\[ALBUM]
clean_dir_struct = False 
#example windows: C:/mp3/albums  -- no trailing slash, use forward slashes only
move_to_dir =
# Rename files, set to true and set one of the options below to True, track_title or track_artist_title
rename_files = False
# 01 - title.mp3
track_title = False 
# 01 - artist - title.mp3
track_artist_title = False
# These aren't necessary if you use CLEAN_DIR_STRUCT OR REMOVE_DIR_AFTER_ITUNES_ADD above
remove_m3u = False
remove_sfv = False
remove_nfo = False
remove_nzb = False

[xbmc]
update_xbmc = False
xbmc_ip = ""
# XBMC: 8080 / Plex: 3000
xbmc_port = 3000 

Re: Write cover / album art images to MP3s - Mac Python script / Win EXE now av

Posted: February 2nd, 2010, 11:27 am
by zakharm
It's a bug.