LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-17-2010, 12:39 PM   #1
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Rep: Reputation: 90
command line album cover download script help


Hi to all. I would like to write a bash script to retrieve album coverart for my music library. First I'd like to ask don't tell me to Google. I've googled until my eyeballs are googlely. I've also searched this forum -- maybe I didn't use the correct terms, I don't know. Anyway I'd like to run the script, go to bed and tomorrow morning all my shiny album covers will be stored in the appropriate album directory.
Here is what I have. I have a dialup internet connection. Don't laugh. Moans and groans are okay. I have MPD with an updated database file. I have current accounts with Amazon, AWS. Also with MusicBrainz and Discogs. I use Tellico to catalog my music. Unfortunately it files the music cover images with filenames that are impossible to associate with the album. I can save the image from Tellico but this is a very tedious process with lots of albums. I have gotten close but it seems help is hard to find. Which tells me a good Linux script for doing this on the command line is archaic and useless in the minds of most people. I'm aware there are plugins for Amarok, etc that do this but I want something for CLI that writes the cover image in each album directly permanently. I have looked over some of the source of plugins and I can't pull what I need from them for a bash script. Much thanks for any help and suggestions.
 
Old 10-18-2010, 07:30 AM   #2
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Hi

I suggest you put down a list of steps that the script would need to execute every time it runs. It is a bit difficult from your post, to follow exactly how you want to achieve the retrieval/storage of your album coverart.

Also how do you associate a given album to a link on a website where the coverart is?
 
Old 10-18-2010, 10:04 AM   #3
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Original Poster
Rep: Reputation: 90
Quote:
Originally Posted by alli_yas View Post
Hi

I suggest you put down a list of steps that the script would need to execute every time it runs. It is a bit difficult from your post, to follow exactly how you want to achieve the retrieval/storage of your album coverart.

Also how do you associate a given album to a link on a website where the coverart is?
The script would retrieve coverart using the accounts I listed in the original post and put it in the appropriate directory, that is to say, the album directory. The script would use a tag tool like id3v2, mp3info, eyeD3, etc to read the album name from a song in each directory and pass that information along with artist name to the website or sites. To recap:
Collect album name and artist
Query website and retrieve cover
Deposit cover to album directory
and do this for every album directory. Your question about how I would associate the information I want with the website(s) is a good one. I hope someone can help because all the php, python, perl and c++ sources I've looked at might as well be written in Greek.

Last edited by SharpyWarpy; 10-18-2010 at 10:14 AM.
 
Old 10-18-2010, 10:33 AM   #4
zhaozhou
LQ Newbie
 
Registered: Oct 2009
Location: Sweden
Distribution: Gentoo
Posts: 23

Rep: Reputation: 1
Well, if you want to create a script yourself, let's break it down, what is it we want to do?

You have a file system with music on in, let's say it uses /media/music/<artist>/<album>/<song>.
You've got a source of cover art, let's say http://example.tld/artist_album.png.

So, what you would have to do is enter /media/music, loop over artist, loop over albums and then download the file.

I wouldn't recommend coding this in Bash, but maybe that's just me (SourceMage has it's package manager written in bash... wow.)
 
Old 10-18-2010, 01:02 PM   #5
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Original Poster
Rep: Reputation: 90
Quote:
Originally Posted by zhaozhou View Post
Well, if you want to create a script yourself, let's break it down, what is it we want to do?

You have a file system with music on in, let's say it uses /media/music/<artist>/<album>/<song>.
You've got a source of cover art, let's say http://example.tld/artist_album.png.

So, what you would have to do is enter /media/music, loop over artist, loop over albums and then download the file.

I wouldn't recommend coding this in Bash, but maybe that's just me (SourceMage has it's package manager written in bash... wow.)
My situation/condition prohibits learning a programming language. It would take me a year to learn Perl, although I think Perl is good. For some idea of what I'm talking take a look here:
http://github.com/pbrisbin/scripts/b...2adc4/coverart
It uses two php scripts, albumart.php and AWSSoapClient.php. If someone knows of a Perl script for this I'll install whatever Perl modules are necessary. As I have said, I have the keys and certs for AWS and MusicBrainz.

Last edited by SharpyWarpy; 10-18-2010 at 01:06 PM.
 
Old 10-18-2010, 05:08 PM   #6
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
sharpy I think what zhaozhou is trying to tell you is to write out all the manual steps you would take to get from point a to point b with getting the album art cover.

No one but you knows what needs to be done without that information; no one can even start helping you construct a script until we know what needs to be done.
 
Old 10-18-2010, 09:04 PM   #7
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Original Poster
Rep: Reputation: 90
Okay what I need to do is use the mpd database to query Amazon or MusicBrainz for the album covers and deposit them into the album directories. I don't know how to put it any plainer than that.
 
Old 05-08-2012, 11:34 PM   #8
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Original Poster
Rep: Reputation: 90
Okay for anyone interested in how to download all your album covers in your music directory at one time. I found a Python script called "coverlovin". Writen by James Stewart, https://launchpad.net/coverlovin. Works beautifully while you sleep. Works recursively to copy the album cover into each directory in which you have the contents of an album with the id3 tags properly done. Name of the image file by default is "cover.jpg" but it does NOT overwrite an existing file by that name, instead renaming it to "cover.jpg.bak". An option is there to download small, medium or large image. Hope this helps many I suspect have been looking for this very thing to work with their ipods, etc that display a cover for the playing music. For some players, whether hardware or software, might need the cover art added to the id3 tag, in which case you should make sure said music files have a version 2 tag. The best id3 editor of which I know to add the cover art is eyeD3. Look for eyeD3. For Fedora just do "yum install python-eyed3". Have fun!

Last edited by SharpyWarpy; 05-08-2012 at 11:35 PM. Reason: additional information
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
An open source program able to successfully load album cover art onto an iPod offling Linux - Software 2 11-15-2009 09:24 PM
creative zen vision w - no album cover art schneidz Linux - Hardware 2 12-02-2008 12:10 AM
LXer: Album Cover Art Downloader makes iPod a touch nicer LXer Syndicated Linux News 0 02-02-2008 03:40 AM
Amarok Album Cover Problem? Koruptor Linux - Software 3 05-15-2007 07:38 PM
download from command line nate11000 Linux - Newbie 4 05-26-2006 05:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration