wolffd@0: function [artist_mbid,artist_found, out] = mb_retrieve_artist_id_from_album_info(artist,album) wolffd@0: wolffd@0: % http://www.musicbrainz.org/ws/2/recording?query=%22we%20will%20rock%20you%22%20AND%20arid:0383dadf-2a4e-4d10-a46a-e9e041da8eb3 wolffd@0: % call python function wolffd@0: str = python('mbid_from_artist_album.py',artist,album) wolffd@0: wolffd@0: % parse text function output wolffd@0: artists = textscan(str,'%s %s','Delimiter','\n'); wolffd@0: mbids = artists{2}; wolffd@0: artist_found = artists{1}{1}; wolffd@0: wolffd@0: % song info API wolffd@0: % url = sprintf('http://www.musicbrainz.org/ws/2/recording?query=%s',urlencode(sprintf('%s AND artist:%s',album,artist))); wolffd@0: url = sprintf('http://www.musicbrainz.org/ws/2/release/%s?inc=artists',urlencode(mbids)); wolffd@0: wolffd@0: [status] = wget(url,' --no-verbose -U firefox -O tmp.xml'); wolffd@0: out = xml2struct('tmp.xml'); wolffd@0: wolffd@0: isrc = []; wolffd@0: artist_mbid = []; wolffd@0: wolffd@0: try wolffd@0: artist_mbid = out.metadata.release.artist_dash_credit.name_dash_credit.artist.Attributes.id; wolffd@0: catch wolffd@0: end wolffd@0: