Commit ab7c22aa authored by Wieland Hoffmann's avatar Wieland Hoffmann Committed by Jean-Baptiste Kempf

musicbrainz.lua: Support

If the Cover Art Archive has artwork for this album, use the 500x500px
version of it.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <>
parent f18236ee
Gets an artwork from amazon
Gets an artwork from the Cover Art Archive or Amazon
Copyright © 2007-2010 the VideoLAN team
......@@ -19,17 +19,22 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
function try_query(query)
local s = query )
function try_query(mbid)
local relquery = "" .. mbid
local s = relquery )
if not s then return nil end
local page = s:read( 65653 )
found, _ = string.find( page, "<artwork>true</artwork>" )
if found then
return ""..mbid.."/front-500"
-- FIXME: multiple results may be available
_, _, asin = string.find( page, "<asin>(%w+)</asin>" )
if asin then
return ""..asin..".01._SCLZZZZZZZ_.jpg"
vlc.msg.dbg("ASIN not found")
vlc.msg.dbg("Neither nor amazon have cover art for this release")
return nil
......@@ -69,8 +74,7 @@ function fetch_art()
releaseid = get_releaseid( recquery )
if releaseid then
relquery = "" .. releaseid
return try_query( relquery )
return try_query( releaseid )
return nil
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment