Write cover album art to MP3s, organize files, iTunes import

Come up with a useful post-processing script? Share it here!
c0ld
Newbie
Newbie
Posts: 48
Joined: March 30th, 2009, 6:28 am

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

Post 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
c0ld
Newbie
Newbie
Posts: 48
Joined: March 30th, 2009, 6:28 am

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

Post 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.
nutski
Release Testers
Release Testers
Posts: 45
Joined: July 6th, 2009, 4:53 am

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

Post 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!
madlan
Release Testers
Release Testers
Posts: 40
Joined: October 8th, 2008, 7:08 am

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

Post 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.
zakharm
Release Testers
Release Testers
Posts: 56
Joined: September 29th, 2008, 1:08 pm

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

Post by zakharm »

I'm on 0.5 beta 6 and it just worked for me.
Write album art post processing script
madlan
Release Testers
Release Testers
Posts: 40
Joined: October 8th, 2008, 7:08 am

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

Post by madlan »

Hi Zakharm, could you detail anything that may help? What options have you set in your config file etc?

Thanks.
zakharm
Release Testers
Release Testers
Posts: 56
Joined: September 29th, 2008, 1:08 pm

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

Post 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
Write album art post processing script
madlan
Release Testers
Release Testers
Posts: 40
Joined: October 8th, 2008, 7:08 am

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

Post 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.
Last edited by madlan on January 18th, 2010, 10:38 am, edited 1 time in total.
zakharm
Release Testers
Release Testers
Posts: 56
Joined: September 29th, 2008, 1:08 pm

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

Post 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.
Write album art post processing script
madlan
Release Testers
Release Testers
Posts: 40
Joined: October 8th, 2008, 7:08 am

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

Post 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.
madlan
Release Testers
Release Testers
Posts: 40
Joined: October 8th, 2008, 7:08 am

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

Post 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!
tafkaj
Newbie
Newbie
Posts: 3
Joined: July 27th, 2009, 5:45 am

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

Post 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
zakharm
Release Testers
Release Testers
Posts: 56
Joined: September 29th, 2008, 1:08 pm

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

Post 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)
Write album art post processing script
phischi
Newbie
Newbie
Posts: 2
Joined: February 2nd, 2010, 10:57 am

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

Post 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 
zakharm
Release Testers
Release Testers
Posts: 56
Joined: September 29th, 2008, 1:08 pm

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

Post by zakharm »

It's a bug.
Write album art post processing script
Post Reply