<?xml version="1.0" encoding="UTF-8"?>
<scraper framework="1.0" date="2009-05-22" name="Discogs" content="albums" thumb="discogs.gif">
	<NfoUrl dest="3">
		<RegExp input="$$1" output="\1" dest="3">
			<expression>(http://www.discogs.com/.*)</expression>
		</RegExp>
	</NfoUrl>
	<CreateAlbumSearchUrl dest="3">
		<RegExp input="$$1" output="http://www.discogs.com/advanced_search?artist=$$2&amp;release_title=\1&amp;btn=Search+Releases" dest="3">
			<expression/>
		</RegExp>
	</CreateAlbumSearchUrl>
	<GetAlbumSearchResults dest="8">
		<RegExp input="$$5" output="&lt;results&gt;\1&lt;/results&gt;" dest="8">
			<RegExp input="$$1" output="&lt;entity&gt;&lt;artist&gt;\2&lt;/artist&gt;&lt;title&gt;\3&lt;/title&gt;&lt;url&gt;http://www.discogs.com\1&lt;/url&gt;&lt;/entity&gt;" dest="5+">
				<expression repeat="yes">&lt;a href=&quot;([^&quot;]*/release/[^&quot;]*)&quot;.*?&gt;(.*?) - (.*?)&lt;/a&gt;</expression>
			</RegExp>
			<expression noclean="1"/>
		</RegExp>		
	</GetAlbumSearchResults>
	<GetAlbumDetails dest="3">
		<RegExp input="$$5" output="&lt;details&gt;\1&lt;/details&gt;" dest="3">
			<RegExp input="$$1" output="&lt;artist&gt;\1&lt;/artist&gt;" dest="5">
				<expression noclean="1">&lt;a href=&quot;/artist/[^&quot;]+&quot;&gt;(.*?)&lt;/a&gt;</expression>
			</RegExp>
			<RegExp input="$$1" output="&lt;title&gt;\1&lt;/title&gt;" dest="5+">
				<expression noclean="1">Add .*? - (.*?) to your collection</expression>
			</RegExp>
			<RegExp input="$$1" output="&lt;rating&gt;\1&lt;/rating&gt;" dest="5+">
				<expression noclean="1">Rating:&lt;/td&gt;.*?&lt;b&gt;([0-9]+).[0-9]&lt;/b&gt;/[0-9]+</expression>
			</RegExp>
			<RegExp input="$$1" output="&lt;label&gt;\1&lt;/label&gt;" dest="5+">
				<expression noclean="1">Label:&lt;/td&gt;.*?&gt;([^&lt;]+)&lt;/a&gt;</expression>
			</RegExp>
			<RegExp input="$$1" output="&lt;releasedate&gt;\1&lt;/releasedate&gt;" dest="5+">
				<expression noclean="1">Released:.*?&lt;td&gt;(.*?)&lt;/td&gt;</expression>
			</RegExp>
			<RegExp input="$$1" output="&lt;year&gt;\1&lt;/year&gt;" dest="5+">
				<expression noclean="1">Released:.*?&lt;td&gt;.*?([0-9]+)&lt;/td&gt;</expression>
			</RegExp>
			<RegExp input="$$1" output="\1" dest="6">
				<expression trim="1">Genre:&lt;/td&gt;&lt;td&gt;(.*?)&lt;/td&gt;</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;genre&gt;\1&lt;/genre&gt;" dest="5+">
				<expression repeat="yes">([^,]+),?</expression>
			</RegExp>
			<RegExp input="$$1" output="\1" dest="6">
				<expression trim="1">Style:&lt;/td&gt;&lt;td&gt;(.*?)&lt;/td&gt;</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;style&gt;\1&lt;/style&gt;" dest="5+">
				<expression repeat="yes">([^,]+),?</expression>
			</RegExp>
			<RegExp input="$$1" output="\1" dest="6">
				<expression noclean="1">Tracklisting:(.*?)&lt;/table&gt;</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;track&gt;&lt;position&gt;\1&lt;/position&gt;&lt;title&gt;\2&lt;/title&gt;&lt;duration&gt;\3&lt;/duration&gt;&lt;/track&gt;" dest="5+">
				<expression repeat="yes">&quot;left&quot;&gt;[^&lt;0-9]*([0-9]+)&lt;/td&gt;[^:]*&lt;td&gt;([^&lt;]+) \(([:0-9]+)\)&lt;/td&gt;</expression> 
			</RegExp>
			<RegExp input="$$1" output="&lt;review&gt;\1&lt;/review&gt;" dest="5+">
				<expression>User Reviews:&lt;/b&gt;[^&lt;]*&lt;blockquote&gt;[^&lt;]*(&lt;div id=.+?)&lt;div id=</expression>
			</RegExp>
			<RegExp input="$$1" output="&lt;url function=&quot;GetImages&quot;&gt;http://www.discogs.com\1&lt;/url&gt;" dest="5+">
				<expression>&lt;a href=&quot;(/viewimages\?release=[^&quot;]*)&quot;</expression>
			</RegExp>
			<expression noclean="1"></expression>
		</RegExp>
	</GetAlbumDetails>
	<GetImages dest="5">
		<RegExp input="$$4" output="&lt;details&gt;&lt;thumbs&gt;\1$$10&lt;/thumbs&gt;&lt;/details&gt;" dest="5">
			<RegExp input="$$1" output="&lt;thumb&gt;\1&lt;/thumb&gt;" dest="4+">
				<expression noclean="1" repeat="yes">img src=&quot;(http://www.discogs.com/image/[^&quot;]*)&quot;</expression>
			</RegExp>
			<expression noclean="1"/>
		</RegExp>
	</GetImages>
	<CreateArtistSearchUrl dest="3">
		<RegExp input="$$2" output="http://www.discogs.com/search?type=artists&amp;q=&quot;\1&quot;&amp;btn=Search" dest="3">
			<RegExp input="$$2" output="\1,%20The" dest="2">
				<RegExp input="$$1" output="\1" dest="2">
					<expression noclean="1"/>
				</RegExp>
				<expression noclean="1" clear="no" repeat="no" trim="1">[Tt]he%20(.+)</expression>
			</RegExp>
			<expression noclean="1"/>
		</RegExp>
	</CreateArtistSearchUrl>
	<GetArtistSearchResults dest="8">
		<RegExp input="$$5" output="&lt;results&gt;\1&lt;/results&gt;" dest="8">
			<!-- exact match -->
			<RegExp input="$$1" output="&lt;entity&gt;&lt;title&gt;\2 \3&lt;/title&gt;&lt;url&gt;http://www.discogs.com\1&lt;/url&gt;&lt;/entity&gt;" dest="5+">
				<!-- artist name variation -->
				<RegExp input="$$1" output="&lt;entity&gt;&lt;title&gt;\2&lt;/title&gt;&lt;url&gt;http://www.discogs.com\1&lt;/url&gt;&lt;/entity&gt;" dest="5+">
					<expression repeat="yes" clear="yes">&lt;a class=&quot;rollover_link&quot; href=&quot;(/artist[^&quot;]*anv=[^&quot;]*)&quot;&gt;(.+?)&lt;p/&gt;</expression>
				</RegExp>
				<expression repeat="yes" clear="no" trim="2,3">&lt;a class=&quot;rollover_link&quot; href=&quot;(/artist[^&quot;]*)&quot;&gt;&lt;span style=&quot;.+?;&quot;&gt;&lt;em&gt;(.+?)[(]artist[)](.*?)&lt;p/&gt;</expression>
			</RegExp>
			<expression noclean="1"/>
		</RegExp>
	</GetArtistSearchResults>
	<GetArtistDetails dest="3" clearbuffers="no">
		<RegExp input="$$5" output="&lt;details&gt;\1&lt;/details&gt;" dest="3">
			<RegExp input="$$1" output="&lt;name&gt;\1&lt;/name&gt;" dest="5">
				<expression noclean="1">Manage your (.*?) collection</expression>
			</RegExp>
			<RegExp input="$$1" output="&lt;biography&gt;\1&lt;/biography&gt;" dest="5+">
				<expression>Profile:(.*?)URLs:</expression>
			</RegExp>
			<RegExp input="$$2" output="&lt;url function=&quot;GetHTBThumbs&quot; post=&quot;yes&quot;&gt;http://www.htbackdrops.com/search.php?search_terms=all&amp;amp;cat_id=5&amp;amp;search_keywords=\1&lt;/url&gt;" dest="5+">
				<expression/>
			</RegExp>
			<RegExp input="$$1" output="&lt;url function=&quot;GetImages&quot;&gt;http://www.discogs.com\1&lt;/url&gt;" dest="5+">
				<expression>a href=&quot;(/viewimages\?artist=[^&quot;]*)&quot;</expression>
			</RegExp>
			<RegExp input="$$2" output="&lt;url function=&quot;GetFanart&quot; post=&quot;yes&quot;&gt;http://www.htbackdrops.com/search.php?search_terms=all&amp;amp;cat_id=1&amp;amp;search_keywords=\1&lt;/url&gt;" dest="5+">
				<expression/>
			</RegExp>
			<expression noclean="1"/>
		</RegExp>
	</GetArtistDetails>
	<GetFanart dest="5">
		<RegExp input="$$13" output="&lt;details&gt;&lt;fanart url=&quot;http://www.htbackdrops.com/&quot;&gt;\1&lt;/fanart&gt;&lt;/details&gt;" dest="5">
			<RegExp input="$$1" output="&lt;thumb preview=&quot;data/thumbnails/\2&quot;&gt;data/media/\2&lt;/thumb&gt;" dest="13">
				<expression noclean="1" repeat="yes">mode=search(&amp;amp;sessionid=[^&quot;]*)?&quot;&gt;&lt;img src=&quot;./data/thumbnails/([^&quot;]+)&quot;</expression>
			</RegExp>
			<expression noclean="1"/>
		</RegExp>
	</GetFanart>
	<GetHTBThumbs dest="5" clearbuffers="no">
		<RegExp input="$$1" output="&lt;thumb preview=&quot;http://www.htbackdrops.com/data/thumbnails/\2&quot;&gt;http://www.htbackdrops.com/data/media/\2&lt;/thumb&gt;" dest="10">
				<expression noclean="1" repeat="yes">mode=search(&amp;amp;sessionid=[^&quot;]*)?&quot;&gt;&lt;img src=&quot;./data/thumbnails/([^&quot;]+)&quot;</expression>
		</RegExp>
	</GetHTBThumbs>
</scraper>
