Hallo everybody.
I would like to know if there is a PHP script able to download an audio cd cover and info from the web. cddb.org give only name album,artist,etc, not the cover image.
Thanks
cd audio cover
Moderator: General Moderators
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
I use http://www.slothradio.com/covers/ to download covers.
This website is online for a long time and searches Amazon for images.
This website is online for a long time and searches Amazon for images.
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
Here is a striped down version what I use in my project.
Code: Select all
<?php
$artist = 'moby';
$album = 'go';
$genre = 'p'; // p = Popular; k = Clasical
$locale = 'us'; // us, uk, de
$matches = '';
$content = file_get_contents('http://www.slothradio.com/covers/?adv=1&artist=' . rawurlencode($artist) . '&album=' . rawurlencode($album) . '&genre=' . $genre . '&imgsize=x&locale=' . $locale);
preg_match_all('/<!-- RESULT ITEM START -->.*?<img src="(http:\/\/(?:images|images-eu)\.amazon\.com.*?)"/s', $content, $matches);
foreach($matches[1] as $image)
echo $image . "<br>";
?>