Cover Fetcher (for AmaroK 1.4)

Amarok 1.x Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

2
Score 50.0%
Description:

Fetches album art from Discogs.com and Last.fm.

The built in Amarok Cover Manager only allows fetching from amazon.com, which may be fine if your music collection largely consists of popular music. But if large parts of your music collection are vinyl rips or releases on underground labels, searching discogs.com will yield much better results.
This script allows fetching album cover art for the currently playing track from discogs.com by clicking onto any track in the playlist and selecting:
"Fetch Covers" -> "For Currently Playing Track"
Already existing local album art (image files from the currently playing track's folder) as well as relevant album art from Last.fm and Discogs.com can then be browsed / saved / deleted.

Hint:
If the window is not opening in the foreground but started minimized with the taskbar item flashing, the KDE focus stealing prevention level doesn't allow focussing our window. This can be fixed by setting this:
System Settings > Window Behaviour > Advanced > Focus Stealing Prevention Level: None

Prerequisites:
- Qt4.4.X
- PyQt4 (Python bindings for QT)

Keyboard Shortcuts:
The GUI can completely be used through keyboard interaction.
Show CoverFetcher Tab: Alt+F
Show Configuration Tab: Alt+C
Show Log Tab: Alt+L
Save image: Alt+S
Delete image: Alt+D
Show next image: Alt+RightArrow
Show previous image: Alt+LeftArrow
(Un)fit cover to window: Alt+Z
Quit: Alt+F4 / Escape
Last changelog:

10 years ago

Version 1.0-2009-02-09
- fixed: discogs.com changed their XML format, so I had to adapt as well
- added: a "search" button for better mouse interaction
Version 0.3.1.1-2008-08-17
- bugfix: program would hang if last.fm were not reachable
Version 0.3.1-2008-08-03
- added: naming schemes (fixed, album name, unambiguous id from discogs/last.fm)
Version 0.3-2008-07-16
- added: support for fetching covers from last.fm
- added: full unicode support
- added: configuration tab
- bugfix: script can now be stopped from Amarok Script Manager
- bugfix: marking text in logwindow will no longer cause text to be inserted in the wrong position
Version 0.2.1-2008-07-09
- GUI keyboard interaction improved
Version 0.2-2008-07-07
- GUI redesign
- many fixes & changes under the hood
Version 0.1-2008-06-23:
- initial release

ajshfjkahk

8 years ago

Unfortunately, script doesn't work on Discogs. I think XML was changed again. In script's log there is something like this "invalid XML (parser error)".

Report

ajshfjkahk

8 years ago

Unfortunately, script doesn't work on Discogs. I think XML was changed again. In script's log there is something like this "invalid XML (parser error)".

Report

hch

9 years ago

Nice script, good idea, but crashes if cover not found. Many pics with poor resolution.

Report

kurumindeoyo

10 years ago

The script doesn't work for me, so I followed the muskatnuss tip. But, in the last step, i.e., the PyQt-x11-gpl-4.4.3 installation, in the "python configure.py", the system give me the following message "Determining the layout of your Qt installation...
Error: Failed to determine the layout of your Qt installation. Try again using
the --verbose flag to see more detail about the problem."
I did look for answers in the Google, but I still found nothing. Please, help me!

Report

kurumindeoyo

10 years ago

The script doesn't work for me, so I followed the muskatnuss tip. But, in the last step, i.e., the PyQt-x11-gpl-4.4.3 installation, in the "python configure.py", the system give me the following message "Determining the layout of your Qt installation...
Error: Failed to determine the layout of your Qt installation. Try again using
the --verbose flag to see more detail about the problem."
I did look for answers in the Google, but I still found nothing. Please, help me!

Report

ciso

10 years ago

I wrote an article about you script on my blog: http://www.de-side.com/blogs/2009/02/09/cover-fetcher-script-per-amarok-che-pesca-da-discogs-e-lastfm/
I think I'm the biggest fan of this script ;)

Report

ciso

10 years ago

Really a great script!
Will you make a port for Amarok2?

P.s. the Last.Fm search I think that doesn't work anymore, so I keep only the discogs one.

Report

C

evod

10 years ago

last.fm works, but the query format must be:
<Artist> - <Album>

discogs.com works - again - since a few days ago they broke my script with a small change in their XML response.

Report

muskatnuss

11 years ago

First of All great SCRIPT !!! =D
love it


but im a bedian user and here you will encounter several problems with it...

using debian etch and gnome 2.14.3

I encountered a big Problem with my debian packaged Version of PyQT.
When i start the script and take a look at the log it says:
Error: Wrong statement
self.discogsLinkLabel.setOpenExternalLinks(True)

this error is caused by PyQT 4.2 and lower
the function setOpenExternalLinks does not exist in packages below 4.4.X

so i build them from source and CoverFetcher works fine now :D

same problem?
solution:

Get the sources needed
$wget http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-x11-gpl-4.4.3.tar.gz
$wget http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.7.7.tar.gz
$wget ftp://ftp.trolltech.no/qt/source/qt-x11-opensource-src-4.4.3.tar.gz

PyQT = python QT bindings
SIP = python qt binder ^^
QT = Qt

now unpack them
$tar xvfz PyQt-x11-gpl-4.4.3.tar.gz
$tar xvfz sip-4.7.7.tar.gz
$tar xvfz qt-x11-opensource-src-4.4.3.tar.gz

installing qt
$cd qt-x11-opensource-src-4.4.3
$./configure | or | $sh configure
$make
$su -c make install

now add the qmake binding to your Exported path
$su -c nano /etc/profile

at the end of this document you find something like:
export PATH

cahnge it to:
export PATH=/usr/local/Trolltech/Qt-4.4.3/bin:$PATH

strg+o to save in editor nano ^^
you could take any you prefer eg. gedit or vim


go voer to install SIP
$cd ..
$cd sip-4.7.7
$python configure.py
$make
$su -c make install

now get on this python qt bindings
$cd ..
$cd PyQt-x11-gpl-4.4.3
$python configure.py
$make
$su -c make install


now all sould be done.
get to amarok and start your CoverFetcher =D

great script and i hope this works 4 you
if you encounter any problems ... let me know

Report

reggler

11 years ago

Hey,

Nice script. Fetching of cover seems to work fine but onse i can see the cover, i hit save but the cover doesn't get added to the song in Amarok and the window stays open. Any idea what i'm doing wrong here?

Thanks!

Report

C

evod

11 years ago

The window won't close if you click save. Press Escape or Alt+F4.

The cover will just be copied to the folder where the album resides, Amarok will notice this only if you activate 'Watch folders for changes' in your Collection options.

Report

bquest

11 years ago

Works for me like a charm. Nevertheless I would have one suggestion or question:

Would it be possible to prescribe a name for the downloaded cover? Like either the Album name or a user set name (like cover.jpg).

I ask this because my mp3 Player displays the Cover art when the device finds a jpg image with "cover.jpg" as filename.

And I think the Amarok script CopyCover is able to convert the folder symbol into the cover image when the picture is named "cover.jpg" as well.

Would be nice to have such a configuration option.

Other than that, really nice work. Thanks!

Report

C

evod

11 years ago

First of all thanks for being fond of my script!

I'm thinking about how to design your proposed feature. Of course there can only be one cover.jpg and how to integrate this into the GUI without cluttering it..

I think of buttons with a functionality like 'Set as Front Cover' and 'Set as Back Cover' where the filenaming can be configured..

If you already have a specific idea on how to realize this or how you would like it just tell me :)


By the way: The use of copycover is not necessary, copycover is used to copy covers from the Amarok cache folder in your home directory to the folder where the album resides. My script copies the cover directly into the folder where the audio files are located, Amarok later finds out about this and copies it into the its cache folder.

Report

bquest

11 years ago

Sorry, I cannot code a single line ...

My reason for mentioning the CopyCover Script was that this script fetches the cover with a name like 646fb67583.jpg from Amarok's cache and copies it into the directory of the respective album (as I may have stated too imprecisely). The script allows you to either take over the album's name or to set the name as being 'Cover.jpg'.

Thus, maybe it is possible to "lend" the respective code from CopyCover and to adapt it to your fine script. I admit that I have no clue if this is feasible ... just an idea.

Best regards,
bquest

Report

C

evod

11 years ago

Here you go, I implemented your requested feature in the newest version, I hope you like it :)

Report

bquest

11 years ago

Wow! Thanks! I don't like it, I LOVE it! All my thumbs up! :-D

Report

bsander

11 years ago

Hi there :)

This sounds like a very useful script! I was wondering if it would be possible to integrate last.fm as an additional cover source in your extension. I find that usually last.fm yields better results for non-english artists than Amazon. And they have a very simple api (see http://www.last.fm/api/ and in particular http://www.last.fm/api/show?service=290 ). I filed this as a wish on Amarok a while ago but so far didn't receive a response.. If you could add this to your script that would be awesome!

Report

C

evod

11 years ago

Hi!
Thanks for the hint, since I am no user of last.fm yet it didn't occur to me to use this as a cover source. I may integrate it in the future, but I'm not sure if there is a real benefit. Are there releases that are featured on last.fm and not on discogs.com? Discogs primarily featured electronic music but have opened up since then.. so could you give me some specific examples where last.fm would be required? (For motivational purposes :)

Report

tzd

11 years ago

After trying it out a bit more I've noticed it only worked with the first cover. I usually get the window for cover fetching but in 99 out of 100 it's greyed out and the only thing i can choose is "close". I am able to edit title etc but since that won't affect anything it won't do me any good.

I'll eagerly await the future releases :)
Thanks again!

Report

C

evod

11 years ago

How do you close the window? If you close it through pressing the escape button then the script won't work anymore. I will fix this in the next release.

If you didn't press escape then please look at the debug output for errors and post them here.

Report

tzd

11 years ago

Hi.

Thanks for a great script!
I'm currently on Kubuntu Hardy (8.04) and I have no issues with the script. I've installed it via Amarok 1.4.9.1 and KDE 3.5.9.

I have a few suggestions for future releases though (freely translated):

1: Have it automatically download instead of default amazon.com or some kind of option where the user can choose from which source the art should be downloaded from. E.g: when you choose album art management and you'll be able to download art for all albums at the same time.

2: Be able to choose download art cover in the left panel and not just within the playlist. E.g: when you rightclick the album art picture.

Great work so far though! :)

Report

C

evod

11 years ago

I would love to make the script work like this, but since this is a script (not a plugin) I can only work with the playlist window (add context menu entries there) and dcop calls (only allows retrieving meta information for currently playing song).

So your two wishes are mine as well, but unfortunately I can't realize them in a script.

Report

vmarinho

11 years ago

I made the change that you indicated but the "invalid syntax" persists.
Obs.: the same situation appears in the line "class DiscogsDataFetcher ():".

I have Python 2.3, 2.4 e 2.5 on my system and I have PyQt too.

Report

C

evod

11 years ago

A python class definition looks like this (# = whitespace)

class name[(expr[,expr]*)]:
####suite

try it with:

class Releases:
####...

I'm just wondering why it works on my system. Since you have several versions of Python installed the question is which one is used for executing the amarok script..

Report

vmarinho

11 years ago

Hy, Evod!
I installed the script but it don't works. There was the following error message when I tried to make it works:
"File "/home/kurumin/.kde/share/apps/amarok/scripts/DiscogsCoverFetcher/DiscogsCoverFetcher.py", line 134
class Releases ():
^
SyntaxError: invalid syntax"
Since now, I thank you for the script and for your (future) help. I need too much this script because my amarok fetch cover don't fetch anymore.

Report

10 years ago

Version 1.0-2009-02-09
- fixed: discogs.com changed their XML format, so I had to adapt as well
- added: a "search" button for better mouse interaction
Version 0.3.1.1-2008-08-17
- bugfix: program would hang if last.fm were not reachable
Version 0.3.1-2008-08-03
- added: naming schemes (fixed, album name, unambiguous id from discogs/last.fm)
Version 0.3-2008-07-16
- added: support for fetching covers from last.fm
- added: full unicode support
- added: configuration tab
- bugfix: script can now be stopped from Amarok Script Manager
- bugfix: marking text in logwindow will no longer cause text to be inserted in the wrong position
Version 0.2.1-2008-07-09
- GUI keyboard interaction improved
Version 0.2-2008-07-07
- GUI redesign
- many fixes & changes under the hood
Version 0.1-2008-06-23:
- initial release

12345678910
product-maker Base: 4 x 5.0 Ratings
DaiVied
Dec 30 2009
ciso
Jan 10 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
1.0
updated Feb 09 2009
added Jun 23 2008
downloads 24h
0
pageviews 24h 1
System Tags addon