# ###################################################################
# Mp3tag (v2.33 or higher) parsing for discogs.com, created by dano on 2005-09-18
# Modified by Snykch
#
# This file should be in your sources directory. On Windows XP it's...
# C:\Documents and Settings\*username*\Application Data\Mp3tag\data\sources
#
# Get the url of the release in discogs, and get the release number
# ie. http://www.discogs.com/release/23455 (you need the 23455)
#
# The script just tags your files in the order it finds them, so make sure your
# releases are complete, and ordered in the main window before attempting to tag.
#
# You can either put the release number in the comment tag of your files, or in
# the box that pops up when you hit the tag button. If you sort all the files and put
# numbers in the comment tag, you can tag all your files in one batch (much easier).
#
#
#
#
#
#
#
# Modifications:
# 2005-09-01: updated coverurl fetching
# 2005-09-18: updated
# 2005-09-19: updated
# 2005-10-11: updated Genre, Title and VA
# 2005-11-06: some tuning
# 2005-11-22: different Artist code
# 2005-12-05: more infos
# 2006-02-02: all VA should be recognized now
# 2006-02-19: updated to get vinyl and catalog no.'s (by Snykch)
# 2006-04-06: updated to get band (by Ydope)
# 2007-01-16: updated to get country, credits, notes (by Ydope)
# 2007-09-02: updated, fields added, gotoline 1 changed (by eric00000007)
# ###################################################################
[Name]=Discogs_ID
[BasedOn]=http://www.discogs.com
[IndexUrl]=http://www.discogs.com/release/%s
[AlbumUrl]=http://www.discogs.com
[WordSeperator]=
[IndexFormat]=%_url%|%artist%|%album%|%type%|%year%
[SearchBy]=%discogs-id%
# or different [SearchBy]
[ParserScriptIndex]=...
# ###################################################################
# I N D E X
# ###################################################################
#debug "on" "C:\C.txt"
sayoutput "CurrentUrl"
say "|"
say " |"
say " |"
say " |"
saynewline
[ParserScriptAlbum]=...
# ###################################################################
# A L B U M
# ###################################################################
debug "on" "C:\D.txt"
findline "Tracklisting:"
findline "
"
findinline ""
# Band
outputto "band"
joinuntil "- "
regexpreplace "\s+" " "
findinline ""
sayuntil "- "
# Album
outputto "album"
findline "- "
findinline "- "
sayuntil "<"
# Coverurl
outputto "coverurl"
findline ""
findinline " | Label: | "
joinuntil " | "
killtag "*"
regexpreplace "^\s+Label:\s+" ""
regexpreplace "\s,\s{2,}" ", "
sayrest
# Catalog Number
outputto "catalog"
gotoline 2
findline "| Catalog#: | "
joinuntil " | "
killtag "*"
regexpreplace "^\s+Catalog\#:\s+" ""
sayrest
# Mediatype
outputto "Mediatype"
findline "| Format: | "
joinuntil " | "
regexpreplace "<[^>]+>" ""
regexpreplace "^\s{0,}Format:\s+" ""
sayrest
# Country:
outputto "country"
gotoline 2
findline "| Country:"
killtag "*"
findinline ":"
movechar 2
sayrest
# year
outputto "year"
findline "Released:"
findinline " | "
# This trick makes sure, that we get the year for both "27 Feb 2004" and "2004" formats
findinline "<"
movechar -5
sayuntil "<"
# Genre (only 1)
outputto "genre"
findline "Genre:"
joinuntil " | "
killtag "*"
regexpreplace "\s+" " "
regexpreplace "\s+$" ""
regexpreplace ",\s[ \w/]+$" ""
findinline "Genre:"
sayrest
# Styles
outputto "Style"
findline "Style:"
joinuntil ""
killtag "*"
regexpreplace "\s+" " "
findinline "Style:"
sayrest
# Credits
outputto "Credits"
findline "| Credits:" 1 1
if " | | Credits:"
joinuntil " | "
regexpreplace " " "; "
killtag "*"
regexpreplace "\|+" " "
regexpreplace "<[^>]+>" ""
regexpreplace "\s+" " "
regexpreplace "^\s" ""
regexpreplace " ; " ";"
regexpreplace ";+" ";"
regexpreplace "\s*\s*$" ""
regexpreplace ";\s*$" ""
regexpreplace " , " ", "
findinline ":"
sayrest
endif
# Notes
outputto "Notes"
gotoline 2
findline "| Notes:" 1 1
if " | | Notes:"
joinuntil " | "
regexpreplace " " "; "
killtag "*"
regexpreplace "\|+" " "
regexpreplace "<[^>]+>" ""
regexpreplace "\s+" " "
regexpreplace "^\s" ""
regexpreplace " ; " ";"
regexpreplace ";+" ";"
regexpreplace "\s*\s*$" ""
regexpreplace ";\s*$" ""
findinline ":"
sayrest
endif
# Artist & Tracks
findline "Tracklisting:"
findline ""
do
outputto "VinylNo."
killtag "*"
regexpreplace "^\s+\d+" ""
sayrest
say "|"
moveline 5
# Artist
outputto "Artist"
joinuntil " | "
killtag "*"
regexpreplace "\s{2,}" " "
sayrest
say "|"
findline ""
# Title
outputto "Tracks"
unspace
killtag "*"
regexpreplace "\s\(\d?\d:\d\d\)" ""
sayuntil " | "
say "|"
findline "" 1 1
while " | "
# End of VA
# ###############################################################
else
gotoline 2
#WWWAUDIOFILE
outputto "wwwaudiofile"
findline ""
findinline ""
# Artist
outputto "artist"
joinuntil ""
regexpreplace "\s{2,}" " "
regexpreplace " \(\d\)" ""
findinline ""
sayuntil " - "
# Album
outputto "album"
findline "- "
findinline "- "
sayuntil "<"
# Cover url
outputto "coverurl"
findline ""
findinline " | Label: | "
joinuntil " | "
killtag "*"
regexpreplace "^\s+Label:\s+" ""
regexpreplace "\s,\s{2,}" ", "
sayrest
# Catalog Number
outputto "catalog"
gotoline 2
findline "| Catalog#: | "
joinuntil " | "
killtag "*"
regexpreplace "^\s+Catalog\#:\s+" ""
sayrest
# Catalog Number
outputto "Comment catalog number"
gotoline 2
findline "| Catalog#: | "
joinuntil " | "
killtag "*"
regexpreplace "^\s+Catalog\#:\s+" ""
sayrest
# Mediatype
outputto "Mediatype"
findline "| Format: | "
joinuntil " | "
regexpreplace "<[^>]+>" ""
regexpreplace "^\s{0,}Format:\s+" ""
sayrest
# Country:
outputto "country"
gotoline 2
findline "| Country:"
killtag "*"
findinline ":"
movechar 2
sayrest
# Year
outputto "year"
findline "Released:"
findinline " | "
# This trick makes sure, that we get the year for both "27 Feb 2004"
# and "2004" formats
findinline "<"
movechar -5
sayuntil "<"
# Genre (only 1)
outputto "genre"
findline "Genre:"
joinuntil " | "
killtag "*"
regexpreplace "\s+" " "
regexpreplace "\s+$" ""
regexpreplace ",\s\w+$" ""
findinline "Genre:"
sayrest
# Styles (all)
outputto "styles"
findline "Style:"
joinuntil ""
killtag "*"
regexpreplace "\s+" " "
findinline "Style:"
sayrest
# Credits
outputto "Credits"
findline "| Credits:" 1 1
if " | | Credits:"
joinuntil " | "
regexpreplace " " "; "
killtag "*"
regexpreplace "\|+" " "
regexpreplace "<[^>]+>" ""
regexpreplace "\s+" " "
regexpreplace "^\s" ""
regexpreplace " ; " ";"
regexpreplace ";+" ";"
regexpreplace "\s*\s*$" ""
regexpreplace "\s*$" ""
regexpreplace ";$" ""
regexpreplace "\s+(.)$" "$1"
regexpreplace " , " ", "
findinline ":"
sayrest
endif
# Notes
outputto "Notes"
gotoline 2
findline "| Notes:" 1 1
if " | | Notes:"
joinuntil " | "
regexpreplace " " "; "
killtag "*"
regexpreplace "\|+" " "
regexpreplace "<[^>]+>" ""
regexpreplace "\s+" " "
regexpreplace "^\s" ""
regexpreplace " ; " ";"
regexpreplace ";+" ";"
regexpreplace "\s*\s*$" ""
regexpreplace "\s*$" ""
regexpreplace ";$" ""
regexpreplace "\s+(.)$" "$1"
findinline ":"
sayrest
endif
# Tracks
findline "Tracklisting:"
findline ""
do
outputto "VinylNo."
killtag "*"
regexpreplace "^\s+\d+" ""
sayrest
say "|"
moveline 6
unspace
if " | | " # emtpy table row WTF!!
exit
else
killtag "*"
regexpreplace "\s\(\d?\d:\d\d\)" ""
# Titles
outputto "tracks"
sayuntil " | "
say "|"
# Mixartist
outputto "mixartist"
moveline 4 1
if " | "
joinuntil " | "
regexpreplace " " "; "
killtag "*"
regexpreplace "\s{2,}" " "
regexpreplace "\s," ","
regexpreplace "\s;" ";"
sayrest
endif
say "|"
findline " " 1 1
endif
while " | "
endif
| |