[Name]=Discogs XML
[BasedOn]=http://www.discogs.com
[AlbumUrl]=http://www.discogs.com/release/%s?f=xml&api_key=1e48c7f4e4
[SearchBy]=%discogsid%
[Encoding]=utf-8
[ParserScriptAlbum]=...
# ###################################################################
# A L B U M
# ###################################################################
#debug "on" "C:\Documents and Settings\Administrator\Application Data\Mp3tag\data\sources\debug.txt" 100
replace "|" ":vrln:"
replace "&" "&"
replace "'" "'"
#fixes missing fields
findinline ""
ifnot ""
gotochar 1
RegexpReplace "" ""
endif
findinline ""
ifnot ""
gotochar 1
RegexpReplace "" ""
endif
findinline ""
ifnot ""
gotochar 1
RegexpReplace "" ""
endif
# NOTES
outputto "NOTES"
gotochar 1
findinline ""
if ""
gotochar 1
findinline ""
sayuntilml ""
endif
gotoline 1
joinuntil ""
replace "|" ":vrln:"
replace "&" "&"
replace "'" "'"
#fixes missing fields (again)
findinline ""
ifnot ""
gotochar 1
RegexpReplace "" ""
endif
findinline ""
ifnot ""
gotochar 1
RegexpReplace "" ""
endif
findinline ""
ifnot ""
gotochar 1
RegexpReplace "" ""
endif
#fixes ARTIST
RegexpReplace "([^<]*?) \(\d+\)" "\1"
RegexpReplace "([^<]*?), ([Tt][Hh][Ee])" "\2 \1"
RegexpReplace "" ""
RegexpReplace "[^<]*?" ""
Replace "" " "
Replace "" " "
RegexpReplace "[^<]*?presents" ""
#fixes TRACK CD separator
regexpreplace "(\d+?)[-.:](\d+?)" "\1-\2"
#fixes LABEL
regexpreplace ")()" "\2\1"
# DISCOGSID
outputto "DISCOGSID"
findinline "id=\""
sayuntil "\""
# BAND
outputto "BAND"
findinline ""
sayuntil ""
# ALBUM
outputto "ALBUM"
findinline ""
sayuntil ""
# CATALOG
outputto "CATALOG"
findinline ""
findinline "catno=\""
sayuntil "\""
findinline "/>"
ifnot ""
do
say ", "
findinline "catno=\""
sayuntil "\""
findinline "/>"
while ""
outputto "RELEASEDATE"
gotochar 1
regexpreplace "(\d{4,})-(\d\d)-(\d\d)" "\2 \3, \1"
regexpreplace "(\d\d) 00, " "\1, "
regexpreplace "(\d\d) 0(\d), " "\1 \2, "
replace "01" "January"
replace "02" "February"
replace "03" "March"
replace "04" "April"
replace "05" "May"
replace "06" "June"
replace "07" "July"
replace "08" "August"
replace "09" "September"
replace "10" "October"
replace "11" "November"
replace "12" "December"
findinline ""
sayuntil ""
endif
endif
endif
# DISCNUMBER
regexpreplace "(\d+?)-(\d+?)" "-\1-\2"
outputto "DISCNUMBER"
findinline ""
if "-"
gotochar 1
do
findinline "-"
sayuntil "-"
say "|"
findinline ""
while ""
while ""
if ""
outputto "ARTIST"
findinline ""
sayuntil ""
outputto "COMPILATION"
set "COMPILATION" ""
say "Yes"
outputto "ARTIST"
else
outputto "ARTIST"
sayoutput "BAND"
endif
say "|"
findinline ""
while ""
while ""
else
say " "
endif
say "|"
movechar -1
findinline ""
while "