Mercurial > hg > camir-aes2014
comparison core/magnatagatune/mb_retrieve_artist_id_from_album_info.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function [artist_mbid,artist_found, out] = mb_retrieve_artist_id_from_album_info(artist,album) | |
2 | |
3 % http://www.musicbrainz.org/ws/2/recording?query=%22we%20will%20rock%20you%22%20AND%20arid:0383dadf-2a4e-4d10-a46a-e9e041da8eb3 | |
4 % call python function | |
5 str = python('mbid_from_artist_album.py',artist,album) | |
6 | |
7 % parse text function output | |
8 artists = textscan(str,'%s %s','Delimiter','\n'); | |
9 mbids = artists{2}; | |
10 artist_found = artists{1}{1}; | |
11 | |
12 % song info API | |
13 % url = sprintf('http://www.musicbrainz.org/ws/2/recording?query=%s',urlencode(sprintf('%s AND artist:%s',album,artist))); | |
14 url = sprintf('http://www.musicbrainz.org/ws/2/release/%s?inc=artists',urlencode(mbids)); | |
15 | |
16 [status] = wget(url,' --no-verbose -U firefox -O tmp.xml'); | |
17 out = xml2struct('tmp.xml'); | |
18 | |
19 isrc = []; | |
20 artist_mbid = []; | |
21 | |
22 try | |
23 artist_mbid = out.metadata.release.artist_dash_credit.name_dash_credit.artist.Attributes.id; | |
24 catch | |
25 end | |
26 |