PHP Classes
elePHPant
Icontem

Album Art Downloader: Retrieve music album images from Amazon.com

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2015-07-20 (13 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 1,917 This week: 2All time: 1,946 This week: 602Up
Version License PHP version Categories  
album_art_downloader 1.2GNU General Publi...4.0Databases, Graphics, Content management, W...
Description Author  

This class can be used to retrieve music album images from Amazon.com site.

It accesses Amazon.com Web services API server and retrieves the URL of music album images.

The class also retrieves the image files into a local server directory and stores the image file names in a MySQL database.

Picture of Nadir Latif
Name: Nadir Latif is available for providing paid consulting. Contact Nadir Latif .
Classes: 14 packages by
Country: Pakistan Pakistan
Age: 32
All time rank: 851 in Pakistan Pakistan
Week rank: 62 Up2 in Pakistan Pakistan Down
Innovation award
Innovation award
Nominee: 9x

Winner: 1x

Details provided by the author  
Made by: Nadir Latif (nadir.latif@yahoo.com)

Dependencies: mp3management (http://www.phpclasses.org/package/4018-PHP-Catalog-MP3-files-in-a-MySQL-database.html).

This script can be used to download album art from amazon.com.

1) Usage:

-Enter database configuration settings in config.inc.php. the database is created using mp3management script.
-Set the variable $path_symbol to "/" if running on linux or "\" if running on windows.
-Enter email of user in set_error_handling.php. All php errors except for notices will be sent to this email address.
-Set the variable $album_art_folder to the location of the album art folder. The downloaded album art images will be saved to this folder.
-To run the script directly from the browser instead of as a background task, set $is_debug variable to 1 and comment line 4. This will display error messages on screen instead of emailing the error.
-Get your amazon webservices id and secret key and enter them on the following lines in get_album_art.php :

define("Access_Key_ID", "Access_Key_ID");
define("Associate_tag", "Associate_tag"); 
define("Amazon_secret_key", "Amazon_secret_key");

-Copy the files to the directory of a web server and run index.php.

2) What does this sctipt do?

The script retrieves rows from a table that contains mp3 meta data such as album,album art,artist etc. Only rows that have album and artist but no album art are retrieved. For each row the script uses the album and artist names to retrieve the album art. The album art image is saved to a folder and the name of the image is saved in the database. The script makes a maximum of one request per second in accordance with the web service usage policy of amazon.com. This script can be used with mp3management script written by myself. The mp3management script retrieves album art from meta tags. For those mp3s that do not have embedded album art, this script can be used to download the album art. The script uses a custom error handler for reporting errors, which emails errors to the user. This is suitable if the script is to be run as a background task or as a cron job.

3)List of files:

a)index.php (initial file)
b)get_album_art.php (main program file)
c)config.inc.php (database configuration file)
d)set_error_handling.php (used to set the error handler to a user defined function)
e)readme.txt (help file)

-Feel free to contact me for any assistance regarding this script.
  Files folder image Files  
File Role Description
Accessible without login Plain text file config.inc.php Conf. database configuration file
Plain text file get_album_art.php Class main program file
Accessible without login Plain text file index.php Example initial file
Plain text file set_error_handling.php Class used to set the error handler to a user defined function
Accessible without login Plain text file readme.txt Doc. help file
Accessible without login Plain text file LICENSE.txt Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%Total:1,917All time:1,946
 This week:2This week:602Up