diff options
author | night199uk <night199uk@xbmc.org> | 2013-05-01 01:47:08 +0800 |
---|---|---|
committer | night199uk <night199uk@xbmc.org> | 2013-05-02 00:36:35 +0800 |
commit | 361696a2d04025bfa2f9e5822baca9e843f07a29 (patch) | |
tree | d575f8d42ea45367c9b5f22776c08efc7553f62b | |
parent | 6297c69926a11ff39158a9272cb2dabab8db27d2 (diff) |
[musicdb] update scrapers to support musicbrainz lookups
-rw-r--r-- | addons/metadata.album.universal/albumuniversal.xml | 8 | ||||
-rw-r--r-- | addons/metadata.artists.universal/artistuniversal.xml | 16 | ||||
-rw-r--r-- | addons/metadata.common.musicbrainz.org/musicbrainz.xml | 22 |
3 files changed, 37 insertions, 9 deletions
diff --git a/addons/metadata.album.universal/albumuniversal.xml b/addons/metadata.album.universal/albumuniversal.xml index 94ed3db07c..b42a21ed5a 100644 --- a/addons/metadata.album.universal/albumuniversal.xml +++ b/addons/metadata.album.universal/albumuniversal.xml @@ -5,6 +5,11 @@ <expression>release/(.+)</expression> </RegExp> </NfoUrl> + <ResolveIDToUrl dest="3"> + <RegExp input="$$1" output="<url>http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url>" dest="3"> + <expression>(.+)</expression> + </RegExp> + </ResolveIDToUrl> <CreateAlbumSearchUrl dest="3"> <RegExp input="$$1" output="<url>http://search.musicbrainz.org/ws/2/release/?fmt=xml&query=release:\1%20AND%20artist:"$$4"</url>" dest="3"> <RegExp input="$$2" output="\1" dest="4"> @@ -57,6 +62,9 @@ <RegExp input="$$3" output="<chain function="GetMBAlbumTitleByMBID">\1</chain>" dest="5"> <expression noclean="1">(.+)</expression> </RegExp> + <RegExp input="$$3" output="<chain function="GetMBAlbumArtistsByMBID">\1</chain>" dest="5+"> + <expression noclean="1">(.+)</expression> + </RegExp> <RegExp input="$$3" output="<chain function="GetMBAlbumArtistByMBID">\1</chain>" dest="5+"> <expression noclean="1">(.+)</expression> </RegExp> diff --git a/addons/metadata.artists.universal/artistuniversal.xml b/addons/metadata.artists.universal/artistuniversal.xml index 48945d7182..8f303211e8 100644 --- a/addons/metadata.artists.universal/artistuniversal.xml +++ b/addons/metadata.artists.universal/artistuniversal.xml @@ -1,10 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <scraper framework="1.1" date="2013-02-27"> <NfoUrl dest="3"> - <RegExp input="$$1" output="<url>http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url>" dest="3"> + <RegExp input="$$1" output="<url>http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url>" dest="3"> <expression>http://musicbrainz.org/artist/(.+)</expression> </RegExp> </NfoUrl> + <ResolveIDToUrl dest="3"> + <RegExp input="$$1" output="<url>http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url>" dest="3"> + <expression>(.+)</expression> + </RegExp> + </ResolveIDToUrl> + <CreateArtistSearchUrl dest="3"> <RegExp input="$$1" output="<url>http://search.musicbrainz.org/ws/2/artist/?fmt=xml&query=artist:"$$4"&limit=100</url>" dest="3"> <RegExp input="$$1" output="\1" dest="4"> @@ -21,10 +27,10 @@ </CreateArtistSearchUrl> <GetArtistSearchResults dest="8"> <RegExp input="$$5" output="<results sorted="yes">\1</results>" dest="8"> - <RegExp input="$$1" output="<entity><title>\2</title><genre>\7</genre><url cache="mb-\1-artist.xml">http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></entity>" dest="9"> + <RegExp input="$$1" output="<entity><title>\2</title><genre>\7</genre><url cache="mb-\1-artist.xml">http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></entity>" dest="9"> <expression repeat="yes" noclean="1">artist id="([^"]*)"(?:\stype="[^"]*")* ext:score="[^"]*"><name>([^<]*)</name>(<sort-name>[^<]*</sort-name>)?(<gender>[^<]*</gender>)?(<country>[^<]*</country>)?(<disambiguation>([^<]*))?</expression> </RegExp> - <RegExp input="$$1" output="<entity><title>\2</title><genre>\7</genre><url cache="mb-\1-artist.xml">http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></entity>" dest="9"> + <RegExp input="$$1" output="<entity><title>\2</title><genre>\7</genre><url cache="mb-\1-artist.xml">http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></entity>" dest="9"> <expression repeat="yes" noclean="1">artist ext:score="[^"]*"(?:\stype="[^"]*")* id="([^"]*)"><name>([^<]*)</name>(<sort-name>[^<]*</sort-name>)?(<gender>[^<]*</gender>)?(<country>[^<]*</country>)?(<disambiguation>([^<]*))?</expression> </RegExp> <RegExp input="$$9" output="\1" dest="5"> @@ -43,8 +49,8 @@ <RegExp input="$$1" output="\2" dest="9"> <expression noclean="1">>http://(www.)?allmusic.com/artist/([^<]*)</expression> </RegExp> - <RegExp input="$$1" output="<name>\1</name>" dest="5"> - <expression noclean="1"><artist(?:\stype="[^"]*")* id="[^"]*"><name>([^<]*)</expression> + <RegExp input="$$1" output="<musicBrainzArtistID>\1</musicBrainzArtistID><name>\2</name>" dest="5"> + <expression noclean="1"><artist(?:\stype="[^"]*")* id="([^"]*)"><name>([^<]*)</expression> </RegExp> <RegExp input="$$8" conditional="fanarttvthumbs" output="<chain function="GetFanartTvArtistThumbsByMBID">\1</chain>" dest="5+"> <expression/> diff --git a/addons/metadata.common.musicbrainz.org/musicbrainz.xml b/addons/metadata.common.musicbrainz.org/musicbrainz.xml index 5ee46d5dc4..a35a9b419f 100644 --- a/addons/metadata.common.musicbrainz.org/musicbrainz.xml +++ b/addons/metadata.common.musicbrainz.org/musicbrainz.xml @@ -17,7 +17,7 @@ </ParseMBDiscography> <GetMBLafeSpanByMBID dest="5" clearbuffers="no"> - <RegExp input="$$1" output="<details><url function="ParseMBLifeSpan" cache="mb-\1-artist.xml">http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url function="ParseMBLifeSpan" cache="mb-\1-artist.xml">http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></details>" dest="5"> <expression noclean="1" /> </RegExp> </GetMBLafeSpanByMBID> @@ -58,7 +58,7 @@ </ParseMBLifeSpan> <GetMBFallbackLafeSpanByMBID dest="5" clearbuffers="no"> - <RegExp input="$$1" output="<details><url function="ParseFallbackMBLifeSpan" cache="mb-\1-artist.xml">http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url function="ParseFallbackMBLifeSpan" cache="mb-\1-artist.xml">http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></details>" dest="5"> <expression noclean="1" /> </RegExp> </GetMBFallbackLafeSpanByMBID> @@ -90,13 +90,27 @@ </GetMBAlbumTitleByMBID> <ParseMBAlbumTitle dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> - <RegExp input="$$1" output="<title>\1</title>" dest="2"> - <expression noclean="1"><release id="[^"]*"><title>([^<]*)<</expression> + <RegExp input="$$1" output="<musicBrainzAlbumID>\1</musicBrainzAlbumID><title>\2</title>" dest="2"> + <expression noclean="1"><release id="([^"]*)"><title>([^<]*)<</expression> </RegExp> <expression noclean="1">(.+)</expression> </RegExp> </ParseMBAlbumTitle> + <GetMBAlbumArtistsByMBID dest="5"> + <RegExp input="$$1" output="<details><url function="ParseMBAlbumArtists" cache="mb-\1-album.xml">http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url></details>" dest="5"> + <expression noclean="1" /> + </RegExp> + </GetMBAlbumArtistsByMBID> + <ParseMBAlbumArtists dest="5"> + <RegExp input="$$2" output="<details>\1</details>" dest="5"> + <RegExp input="$$1" output="<albumArtistCredits><joinphrase>\1</joinphrase><musicBrainzArtistID>\2</musicBrainzArtistID><artist>\3</artist></albumArtistCredits>" dest="2"> + <expression repeat="yes" noclean="1">(?:joinphrase="([^"]*)">)?<artist\sid="([^"]*)"><name>([^<]*)<</expression> + </RegExp> + <expression noclean="1">(.+)</expression> + </RegExp> + </ParseMBAlbumArtists> + <GetMBAlbumArtistByMBID dest="5"> <RegExp input="$$1" output="<details><url function="ParseMBAlbumArtist" cache="mb-\1-album.xml">http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url></details>" dest="5"> <expression noclean="1" /> |