Skip to content

Commit

Permalink
[musicdb] update scrapers to support musicbrainz lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
night199uk committed May 1, 2013
1 parent 6297c69 commit 361696a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
8 changes: 8 additions & 0 deletions addons/metadata.album.universal/albumuniversal.xml
Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down
16 changes: 11 additions & 5 deletions 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">
Expand All @@ -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">
Expand All @@ -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/>
Expand Down
22 changes: 18 additions & 4 deletions addons/metadata.common.musicbrainz.org/musicbrainz.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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" />
Expand Down

0 comments on commit 361696a

Please sign in to comment.