aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornight199uk <night199uk@xbmc.org>2013-05-01 01:47:08 +0800
committernight199uk <night199uk@xbmc.org>2013-05-02 00:36:35 +0800
commit361696a2d04025bfa2f9e5822baca9e843f07a29 (patch)
treed575f8d42ea45367c9b5f22776c08efc7553f62b
parent6297c69926a11ff39158a9272cb2dabab8db27d2 (diff)
[musicdb] update scrapers to support musicbrainz lookups
-rw-r--r--addons/metadata.album.universal/albumuniversal.xml8
-rw-r--r--addons/metadata.artists.universal/artistuniversal.xml16
-rw-r--r--addons/metadata.common.musicbrainz.org/musicbrainz.xml22
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="&lt;url&gt;http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings&lt;/url&gt;" dest="3">
+ <expression>(.+)</expression>
+ </RegExp>
+ </ResolveIDToUrl>
<CreateAlbumSearchUrl dest="3">
<RegExp input="$$1" output="&lt;url&gt;http://search.musicbrainz.org/ws/2/release/?fmt=xml&amp;query=release:\1%20AND%20artist:&quot;$$4&quot;&lt;/url&gt;" dest="3">
<RegExp input="$$2" output="\1" dest="4">
@@ -57,6 +62,9 @@
<RegExp input="$$3" output="&lt;chain function=&quot;GetMBAlbumTitleByMBID&quot;&gt;\1&lt;/chain&gt;" dest="5">
<expression noclean="1">(.+)</expression>
</RegExp>
+ <RegExp input="$$3" output="&lt;chain function=&quot;GetMBAlbumArtistsByMBID&quot;&gt;\1&lt;/chain&gt;" dest="5+">
+ <expression noclean="1">(.+)</expression>
+ </RegExp>
<RegExp input="$$3" output="&lt;chain function=&quot;GetMBAlbumArtistByMBID&quot;&gt;\1&lt;/chain&gt;" 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="&lt;url&gt;http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;" dest="3">
+ <RegExp input="$$1" output="&lt;url&gt;http://musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;" dest="3">
<expression>http://musicbrainz.org/artist/(.+)</expression>
</RegExp>
</NfoUrl>
+ <ResolveIDToUrl dest="3">
+ <RegExp input="$$1" output="&lt;url&gt;http://musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;" dest="3">
+ <expression>(.+)</expression>
+ </RegExp>
+ </ResolveIDToUrl>
+
<CreateArtistSearchUrl dest="3">
<RegExp input="$$1" output="&lt;url&gt;http://search.musicbrainz.org/ws/2/artist/?fmt=xml&amp;query=artist:&quot;$$4&quot;&amp;limit=100&lt;/url&gt;" dest="3">
<RegExp input="$$1" output="\1" dest="4">
@@ -21,10 +27,10 @@
</CreateArtistSearchUrl>
<GetArtistSearchResults dest="8">
<RegExp input="$$5" output="&lt;results sorted=&quot;yes&quot;&gt;\1&lt;/results&gt;" dest="8">
- <RegExp input="$$1" output="&lt;entity&gt;&lt;title&gt;\2&lt;/title&gt;&lt;genre&gt;\7&lt;/genre&gt;&lt;url cache=&quot;mb-\1-artist.xml&quot;&gt;http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;&lt;/entity&gt;" dest="9">
+ <RegExp input="$$1" output="&lt;entity&gt;&lt;title&gt;\2&lt;/title&gt;&lt;genre&gt;\7&lt;/genre&gt;&lt;url cache=&quot;mb-\1-artist.xml&quot;&gt;http://musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;&lt;/entity&gt;" dest="9">
<expression repeat="yes" noclean="1">artist id=&quot;([^&quot;]*)&quot;(?:\stype=&quot;[^&quot;]*&quot;)* ext:score=&quot;[^&quot;]*&quot;&gt;&lt;name&gt;([^&lt;]*)&lt;/name&gt;(&lt;sort-name&gt;[^&lt;]*&lt;/sort-name&gt;)?(&lt;gender&gt;[^&lt;]*&lt;/gender&gt;)?(&lt;country&gt;[^&lt;]*&lt;/country&gt;)?(&lt;disambiguation&gt;([^&lt;]*))?</expression>
</RegExp>
- <RegExp input="$$1" output="&lt;entity&gt;&lt;title&gt;\2&lt;/title&gt;&lt;genre&gt;\7&lt;/genre&gt;&lt;url cache=&quot;mb-\1-artist.xml&quot;&gt;http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;&lt;/entity&gt;" dest="9">
+ <RegExp input="$$1" output="&lt;entity&gt;&lt;title&gt;\2&lt;/title&gt;&lt;genre&gt;\7&lt;/genre&gt;&lt;url cache=&quot;mb-\1-artist.xml&quot;&gt;http://musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;&lt;/entity&gt;" dest="9">
<expression repeat="yes" noclean="1">artist ext:score=&quot;[^&quot;]*&quot;(?:\stype=&quot;[^&quot;]*&quot;)* id=&quot;([^&quot;]*)&quot;&gt;&lt;name&gt;([^&lt;]*)&lt;/name&gt;(&lt;sort-name&gt;[^&lt;]*&lt;/sort-name&gt;)?(&lt;gender&gt;[^&lt;]*&lt;/gender&gt;)?(&lt;country&gt;[^&lt;]*&lt;/country&gt;)?(&lt;disambiguation&gt;([^&lt;]*))?</expression>
</RegExp>
<RegExp input="$$9" output="\1" dest="5">
@@ -43,8 +49,8 @@
<RegExp input="$$1" output="\2" dest="9">
<expression noclean="1">&gt;http://(www.)?allmusic.com/artist/([^&lt;]*)</expression>
</RegExp>
- <RegExp input="$$1" output="&lt;name&gt;\1&lt;/name&gt;" dest="5">
- <expression noclean="1">&lt;artist(?:\stype=&quot;[^&quot;]*&quot;)* id=&quot;[^&quot;]*&quot;&gt;&lt;name&gt;([^&lt;]*)</expression>
+ <RegExp input="$$1" output="&lt;musicBrainzArtistID&gt;\1&lt;/musicBrainzArtistID&gt;&lt;name&gt;\2&lt;/name&gt;" dest="5">
+ <expression noclean="1">&lt;artist(?:\stype=&quot;[^&quot;]*&quot;)* id=&quot;([^&quot;]*)&quot;&gt;&lt;name&gt;([^&lt;]*)</expression>
</RegExp>
<RegExp input="$$8" conditional="fanarttvthumbs" output="&lt;chain function=&quot;GetFanartTvArtistThumbsByMBID&quot;&gt;\1&lt;/chain&gt;" 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="&lt;details&gt;&lt;url function=&quot;ParseMBLifeSpan&quot; cache=&quot;mb-\1-artist.xml&quot;&gt;http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;&lt;/details&gt;" dest="5">
+ <RegExp input="$$1" output="&lt;details&gt;&lt;url function=&quot;ParseMBLifeSpan&quot; cache=&quot;mb-\1-artist.xml&quot;&gt;http://musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;&lt;/details&gt;" dest="5">
<expression noclean="1" />
</RegExp>
</GetMBLafeSpanByMBID>
@@ -58,7 +58,7 @@
</ParseMBLifeSpan>
<GetMBFallbackLafeSpanByMBID dest="5" clearbuffers="no">
- <RegExp input="$$1" output="&lt;details&gt;&lt;url function=&quot;ParseFallbackMBLifeSpan&quot; cache=&quot;mb-\1-artist.xml&quot;&gt;http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;&lt;/details&gt;" dest="5">
+ <RegExp input="$$1" output="&lt;details&gt;&lt;url function=&quot;ParseFallbackMBLifeSpan&quot; cache=&quot;mb-\1-artist.xml&quot;&gt;http://musicbrainz.org/ws/2/artist/\1?inc=url-rels&lt;/url&gt;&lt;/details&gt;" dest="5">
<expression noclean="1" />
</RegExp>
</GetMBFallbackLafeSpanByMBID>
@@ -90,13 +90,27 @@
</GetMBAlbumTitleByMBID>
<ParseMBAlbumTitle dest="5">
<RegExp input="$$2" output="&lt;details&gt;\1&lt;/details&gt;" dest="5">
- <RegExp input="$$1" output="&lt;title&gt;\1&lt;/title&gt;" dest="2">
- <expression noclean="1">&lt;release id=&quot;[^&quot;]*&quot;&gt;&lt;title&gt;([^&lt;]*)&lt;</expression>
+ <RegExp input="$$1" output="&lt;musicBrainzAlbumID&gt;\1&lt;/musicBrainzAlbumID&gt;&lt;title&gt;\2&lt;/title&gt;" dest="2">
+ <expression noclean="1">&lt;release id=&quot;([^&quot;]*)&quot;&gt;&lt;title&gt;([^&lt;]*)&lt;</expression>
</RegExp>
<expression noclean="1">(.+)</expression>
</RegExp>
</ParseMBAlbumTitle>
+ <GetMBAlbumArtistsByMBID dest="5">
+ <RegExp input="$$1" output="&lt;details&gt;&lt;url function=&quot;ParseMBAlbumArtists&quot; cache=&quot;mb-\1-album.xml&quot;&gt;http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings&lt;/url&gt;&lt;/details&gt;" dest="5">
+ <expression noclean="1" />
+ </RegExp>
+ </GetMBAlbumArtistsByMBID>
+ <ParseMBAlbumArtists dest="5">
+ <RegExp input="$$2" output="&lt;details&gt;\1&lt;/details&gt;" dest="5">
+ <RegExp input="$$1" output="&lt;albumArtistCredits&gt;&lt;joinphrase&gt;\1&lt;/joinphrase&gt;&lt;musicBrainzArtistID&gt;\2&lt;/musicBrainzArtistID&gt;&lt;artist&gt;\3&lt;/artist&gt;&lt;/albumArtistCredits&gt;" dest="2">
+ <expression repeat="yes" noclean="1">(?:joinphrase=&quot;([^&quot;]*)&quot;&gt;)?&lt;artist\sid=&quot;([^&quot;]*)&quot;&gt;&lt;name&gt;([^&lt;]*)&lt;</expression>
+ </RegExp>
+ <expression noclean="1">(.+)</expression>
+ </RegExp>
+ </ParseMBAlbumArtists>
+
<GetMBAlbumArtistByMBID dest="5">
<RegExp input="$$1" output="&lt;details&gt;&lt;url function=&quot;ParseMBAlbumArtist&quot; cache=&quot;mb-\1-album.xml&quot;&gt;http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings&lt;/url&gt;&lt;/details&gt;" dest="5">
<expression noclean="1" />