<?xml version="1.0" encoding="UTF-8"?>
<scraper framework="1.1" date="2009-09-16" name="Discogs" content="albums" thumb="discogs.gif" language="en">
	<include>common/htbackdrops.xml</include>
	<GetSettings dest="3">
		<RegExp input="$$5" output="&lt;settings&gt;\1&lt;/settings&gt;" dest="3">
			<RegExp input="$$1" output="&lt;setting label=&quot;Enable Fanart&quot; type=&quot;bool&quot; id=&quot;htbfanart&quot; default=&quot;true&quot;&gt;&lt;/setting&gt;" dest="5+">
				<expression/>
			</RegExp>
			<RegExp input="$$1" output="&lt;setting label=&quot;Grab thumbs from HTBackdrops&quot; type=&quot;bool&quot; id=&quot;htbthumbs&quot; default=&quot;true&quot;&gt;&lt;/setting&gt;" dest="5+">
				<expression/>
			</RegExp>
			<expression noclean="1"/>
		</RegExp>
	</GetSettings>
	<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"/>
		</RegExp>
	</GetAlbumDetails>
	<GetImages dest="5">
		<RegExp input="$$4" output="&lt;details&gt;\1&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">
			<RegExp input="$$1" output="&lt;entity&gt;&lt;title&gt;\2&lt;/title&gt;&lt;url&gt;http://www.discogs.com/artist/\1&lt;/url&gt;&lt;/entity&gt;" dest="5+">
				<expression repeat="yes">&lt;a href=&quot;/artist/([^&quot;]*)&quot; class=&quot;rollover_link&quot;&gt;(.+?)&lt;/a&gt;</expression>
			</RegExp>
			<expression noclean="1"/>
		</RegExp>
	</GetArtistSearchResults>
	<GetArtistDetails dest="3">
		<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" conditional="htbthumbs" 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" conditional="htbfanart" output="&lt;url function=&quot;GetHTBFanart&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>
</scraper>
