Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: iTunesArt (Read 18480 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

iTunesArt

This is a small program based on iTunes.boo from AlbumArtDownloader (by Alex Vallat and myself) to download iTMS art.
Why would you use this over AlbumArtDownloader? Well the quality of iTunes covers is such that I'm not afraid of getting the wrong cover for an album, and it's easier to just run a script and let it do everything automatically.

This version only downloads one image per execution, so can be easily scripted from a BAT file to fit in with your directory structure.
Code: [Select]
Usage: iTunesArt <artist> <album> <path to save (without extension)>
Example: iTunesArt "Pink Floyd" "The Piper at the Gates of Dawn" "Floyd\Piper\folder"

Example bat file for Artist\Album directory structure, saving as folder.jpg/folder.png:
Code: [Select]
@echo off
set scriptdir=%cd%
pushd D:\music\albums
for /D %%G IN (*) DO (cd %%G
    for /D %%U IN (*) DO (
    IF NOT EXIST "%%U\folder.jpg" IF NOT EXIST "%%U\folder.png" %scriptdir%\iTunesArt.exe "%%G" "%%U" "%%U\folder"
    )
    cd ..
)
popd

Some images are only available in TIFF format, and the script will convert these automatically to PNG, to save disk space.
Download: [attachment=3794:attachment]

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

Here is the original version which automatically traverses your directory structure (less flexible than the above)
Code: [Select]
Usage: iTunesArt <artist level> <album level> <art filename> <root directory>
Example: For music stored as Artist\Album\Track.format, art stored in folder.jpg
<artist level> = 1, <album level> = 2, <art filename> = folder (no extension), eg:
> iTunesArt.exe 1 2 folder "C:\users\dave\Music"

Hopefully the way it reads directory structure is apparent from the above. Source is included.
Download: [attachment=3792:attachment]
Replacement executable which uses a different StoreFront value (dll from above download required): [attachment=3793:attachment]

iTunesArt

Reply #1
This program kicks ass! 

For trial purposes, i moved my Pedro the lion albums to a "Artist\Album" type directory structure (my structure is currently "Genre\Artist\[date] Album\" which i don't know how to enter  ). At first i got an "operation timed out" error, but it worked flawlessly on the second try fetching album arts that were 900X900,600X600 and 1417X1417. Awesome!

A "feature request" would be to allow the directory structure to be customizable... how do i make it work on my structure?

iTunesArt

Reply #2
This program kicks ass! 

For trial purposes, i moved my Pedro the lion albums to a "Artist\Album" type directory structure (my structure is currently "Genre\Artist\[date] Album\" which i don't know how to enter  ). At first i got an "operation timed out" error, but it worked flawlessly on the second try fetching album arts that were 900X900,600X600 and 1417X1417. Awesome!

A "feature request" would be to allow the directory structure to be customizable... how do i make it work on my structure?


I did intend for the structure to be customisable, but didn't foresee anyone including the year in their album folder. If you didn't have the '[date]' part, you would use:
Code: [Select]
iTunesArt 2 3 folder <music path>

Otherwise the easiest way is probably just to edit the sourcecode to adapt it to your situation.

iTunesArt

Reply #3
Testing it out now

Why does the company say Hewlett-Packard though ? You work for them ?

I would love it to work with my folder setup, which is root/Artist - Albumname (year)/ for each album.

Right now I cant figure out how to get that to work. I really like the idea! Sweet.

iTunesArt

Reply #4
Testing it out now 

Why does the company say Hewlett-Packard though ? You work for them ?

No. I have an HP laptop though. No idea why Visual Studio insists on inserting 'Hewlett-Packard' into everything I compile  .
Quote
I would love it to work with my folder setup, which is root/Artist - Albumname (year)/ for each album.

Right now I cant figure out how to get that to work. I really like the idea! Sweet.


Yea, it wont work. Have a go at modifying the source to your situation if you've got a C# compiler (you can get one for free from Microsoft, or from http://www.mono-project.com/

iTunesArt

Reply #5
Testing it out now 

Why does the company say Hewlett-Packard though ? You work for them ?

No. I have an HP laptop though. No idea why Visual Studio insists on inserting 'Hewlett-Packard' into everything I compile  .
Quote
I would love it to work with my folder setup, which is root/Artist - Albumname (year)/ for each album.

Right now I cant figure out how to get that to work. I really like the idea! Sweet.


Yea, it wont work. Have a go at modifying the source to your situation if you've got a C# compiler (you can get one for free from Microsoft, or from http://www.mono-project.com/


Ok I will. This will be my first C# code, but having looked at the one you supplied I think I could be able to do it... I only know Java, but it doesnt seem like an impossibility.

Will let you know if I can do it

Update: yeah, I cant  And I dont have enough time to understand it. I get an error message saying a problem with the namespace name Generic. I have no clue  Anyway, if someone should happen to take this task on I would love to hear about it.

iTunesArt

Reply #6
sounds nice but i have no idea how to use it.

iTunesArt

Reply #7
I would love it to work with my folder setup, which is root/Artist - Albumname (year)/ for each album.

Right now I cant figure out how to get that to work. I really like the idea! Sweet.


Try the 'Non-recursive version' from the second part of the first post.

iTunesArt

Reply #8
I took my time to modify david_dl's source a bit to suite my own needs a bit better. Now the program understands basic folder name patterns, parsing %artist%, %album% and %ignore%.  %artist% and %album% can contain both "word" and "non-word" characters, %ignore% is just for "word" characters, so you have to add multiple space-separated %ignore%-s for multiple words to ignore.
Currently this does not work for multiple folder levels, so something like "%artist%\(%ignore%) %album%" would not match anything, it could even break.

Usage is something like this:
Code: [Select]
iTunesArt -path=<root directory> -fileName=<art filename w/o extension> -pattern=<folder pattern>
Example: For music stored as \"Artist - (Year) Album\\Track\" format, art stored in folder.jpg
iTunesArt -path="c:\My\Music" -fileName=folder -pattern="%artist% - (%ignore%) %album%"
Executing without parameters uses the pattern from the example on folder.jpgs in the current folder.


As this is my first adventure in C#-Land, I may have made ugly mistakes - please feel free to correct them.

The command line parser used was found online here, I think I am allowed to include it in the code.

If you have any problems with me publishing this modified program, david_dl, please say so and I will remove it.

[attachment=3796:attachment]
Life is Real...
(But not in audio :) )

iTunesArt

Reply #9
 

Sweet! That worked very well Kalmark.  Although it seems to stop occasionally, trying to write a JPG file, but somehow is unable to. Could have to do with the image conversion? When trying to open the file that it currently seems to be working on, its a broken JPG that will show up as black.  But it does work with my folder structure, and thats awesome.

UPDATE: So its actually just working on probably doing the image conversion, not stoping. Give it some time and it will continue. So in other words, this works perfectly now.


Good job!

iTunesArt

Reply #10
Any chance this would search through the japanese iTunes music store?

iTunesArt

Reply #11
Any chance this would search through the japanese iTunes music store?


You would need to find out the 'Store Front' value for the japanese store, possibly by intercepting the traffic between iTunes and the iTMS servers when iTunes is using a japanese iTMS account. This can then be incorporated into the script.

iTunesArt

Reply #12
This is fabulous david_dl. 

I have also gone from the boo code to your new C# code for a GUI version of this for iTunes users with full credit to you!

5.11.7.2 Search iTMS artwork during validation of last 100 tracks was ignored
5.11.7.1 CheckBoxes in Checks tab will now be remembered for next launch of iTSfv [Jojo]
5.11.7.0 Implemented several code optimizations to improve performance in validating tracks
5.11.6.5 Prevented rare cases where iTSfv could sometimes fail to overwrite folder.jpg
5.11.6.4 Remix tags for CD Singles will be ignored while searching for iTMS artwork [Jojo]
5.11.6.3 Using improved iTMS artwork search code thanks to david_dl from http://www.hydrogenaudio.org/forums/index....showtopic=57720
5.11.6.2 If folder artwork dimensions match the embedded artwork dimensions, iTSfv did not look for iTMS artwork
5.11.6.1 Artwork available as TIF in iTMS were not found; they will now be converted to JPG and used as iTMS Artwork source
5.11.6.0 iTSfv will now search for Artwork from all the available iTunes Music stores in the world

Hope you don't mind.

The GUI version searches for all the iTunes Music stores available

Code: [Select]
                ' start searching itms artwork
                Dim listStores As New List(Of cITunesStore)
                listStores.Add(New cITunesStore("China", 143459))
                listStores.Add(New cITunesStore("United States", 143441))
                listStores.Add(New cITunesStore("Australia", 143460))
                listStores.Add(New cITunesStore("United Kindom", 143444))
                listStores.Add(New cITunesStore("Norway", 143457))
                listStores.Add(New cITunesStore("Canada", 143455))
                listStores.Add(New cITunesStore("Germany", 143443))
                listStores.Add(New cITunesStore("New Zealand", 143452))
                listStores.Add(New cITunesStore("Japan", 143462))
                listStores.Add(New cITunesStore("Denmark", 143458))
                listStores.Add(New cITunesStore("France", 143442))

                ' TODO: To Add these to list
                '143445 => 'AT',
                '143446 => 'BE',
                '143447 => 'FI',
                '143448 => 'GR',
                '143449 => 'IE',
                '143450 => 'IT',
                '143451 => 'LU',
                '143453 => 'PT',
                '143454 => 'SP',
                '143456 => 'SE',


You can easily do it like that.

iTunesArt

Reply #13
excuse my ignorance, but how is this used?
Song List: keikoniumboards.ke.funpic.org/files/songlist.html


iTunesArt

Reply #15
excuse my ignorance, but how is this used?


To download the art for an album, and save it in folder.jpg/folder.png depending on format:
Code: [Select]
itunesart "The Mint Chicks" "Crazy? Yes! Dumb? No!" "folder"

(from the commandline).

To search through your albums and download art for those without any, save this as a .cmd file, in the same folder as itunesart.exe, and run the script (assuming your albums are in an Artist\Album structure, if not, modify the batch file):

Code: [Select]
@echo off
set scriptdir=%cd%
pushd C:\users\david\music\albums
for /D %%G IN (*) DO (cd %%G
    for /D %%U IN (*) DO (
    IF NOT EXIST "%%U\folder.jpg" IF NOT EXIST "%%U\folder.png" %scriptdir%\iTunesArt.exe "%%G" "%%U" "%%U\folder"
    )
    cd ..
)
popd

iTunesArt

Reply #16
hi,

wow, great work! this is amazing!

sorry, but i m not very good in this commandline-thing.

how i have to modify my batch if my structure is like that:

Quote
F:\Musik\A-C\Andy Timmons - Pawn Kings



thx in advance

iTunesArt

Reply #17
hi,

wow, great work! this is amazing! 

sorry, but i m not very good in this commandline-thing.

how i have to modify my batch if my structure is like that:

Quote
F:\Musik\A-C\Andy Timmons - Pawn Kings



thx in advance 

Try this:
Code: [Select]
@echo off
set scriptdir=%cd%
cd /d F:\musik
for /D %%G IN (*) DO (cd %%G
    for /D %%U IN (*) DO CALL :process_album "%%U"
    cd ..
)
pause
goto :eof
:process_album
set curdir=###%1###
set curdir=%curdir:"###=%
set curdir=%curdir:###"=%
set album=%curdir:*- =%
call set artist=%%curdir: - %album%=%%
%scriptdir%\itunesart "%artist%" "%album%" "%curdir%\folder"
goto :eof

iTunesArt

Reply #18
Hi david_dl,

Is iTunes up to something?

Quote
Searching for '50 Cent' - 'Curtis' => "H:\Users\Manno\Desktop\iTunesArtCmd\Music
\50 Cent\Curtis\folder"
Failed: The remote server returned an error: (403) Forbidden.
Press any key to continue . . .


Same results for all the other stores from the gui version:

Quote
20070927T092851 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (United States)
20070927T092852 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (Australia)
20070927T092852 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (United Kindom)
20070927T092852 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (Norway)
20070927T092852 iTMS Artwork http://a1.phobos.apple.com/r40/Music/68/5b...dj.njxvgobl.tif was not retrievable from iTMS (Norway).
20070927T092852 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (Canada)
20070927T092852 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (Germany)
20070927T092853 iTMS Artwork http://a1.phobos.apple.com/eu/r40/Music/68...dj.njxvgobl.tif was not retrievable from iTMS (Germany).
20070927T092853 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (New Zealand)
20070927T092853 iTMS Artwork http://a1.phobos.apple.com/eu/r40/Music/68...dj.njxvgobl.tif was not retrievable from iTMS (New Zealand).
20070927T092853 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (Japan)
20070927T092853 iTMS Artwork http://a1.phobos.apple.com/eu/r40/Music/68...dj.njxvgobl.tif was not retrievable from iTMS (Japan).
20070927T092853 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (China)
20070927T092854 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (Denmark)
20070927T092854 Searching iTMS Artwork for 50 Cent - Curtis using iTunes Store (France)
20070927T092854 iTMS Artwork http://a1.phobos.apple.com/eu/r40/Music/68...dj.njxvgobl.tif was not retrievable from iTMS (France).
20070927T092854 Could not find iTMS Artwork in any store.


iTunesArt

Reply #20
Ah well, at least the tool performed the task it was initially intended for - to get nice, accurate art for all the albums on my computer at once with minimal effort. When I rip new CDs I can just use AlbumArtDownloader. Bad luck to anyone who missed out. I'm guessing the temporary availability of unencrypted art was just a glitch on apple's behalf, but hopefully soon someone will work out how to decrypt the encrypted stuff soon.

iTunesArt

Reply #21
damn i missed out, i was gonna do my whole collection tonight! any chance some1 could pm me if it comes online again. thanks

iTunesArt

Reply #22
You should still be able to get the artwork through iTunes described here.
Can't wait for a HD-AAC encoder :P