From: David N. <jud...@ad...> - 2002-08-17 19:05:41
|
I recently discovered it is fairly easy to download album art from real.com. If you format a URL like this, http://artistguide.real.com/?artist=mohammedrafi&album=The%20Golden%20Collec tion you get back an html file that refers to the album art image like this, http://chillout.real.com/pics/channels/amg/pop/cov75/dre800/e810/e81099o 5nrs.jpg There is also a larger version here, http://chillout.real.com/pics/channels/amg/pop/cov200/dre800/e810/e81099 o5nrs.jpg Here is example code for downloading a bunch of images. #! /usr/bin/perl use LWP::Simple; open i, "cds.CSV"; my $t = <i>; foreach (<i>) { ($t,$cd,$ar) = split /","/; $ar =~ s/ /_/g; $cd =~ s/ /_/g; my $jpg = $ar . '-' . $cd . '.jpg'; $jpg =~ s/'//g; next if -e "images/$jpg" and -e "images_large/$jpg"; $ar =~ s/_//g; $ar =~ s/(\S+)(The)$/\2\1/g; $cd =~ s/_\(.+\)//g; $cd =~ s/_\[.+\]//g; $cd =~ s/_/%20/g; my $url = 'http://artistguide.real.com/?artist=' . $ar . '&album=' . $cd; my $html = get $url; print "couldn't get $ar $cd \n" unless $html; my ($art) = $html =~ /alb_art = "(\S+)"/; $art =~ s/:/:/; if ($art eq 'def') { print "Can't find art for $ar $cd\n"; next; } getstore $art , "images/$jpg" unless -e "images/$jpg"; $art =~ s/cov75/cov200/; getstore $art , "images_large/$jpg" unless -e "images_large/$jpg"; } |