# ###################################################################
# Mp3tag (v2.33+) parsing for discogs.com
#
# Search by ARTIST
# This file should be in your sources directory
# On Windows XP it's
# C:\Documents and Settings\*username*\Application Data\Mp3tag\data\sources
#
# Modifications:
# 2005-11-22: updated
# 2006-05-23: updated
# 2007-08-26: modified (%artist% is now retrieved for each track separately if present)
# This one needs explanation. Tracks on most albums and CDMs have one artist, which
# may be obtained from
tag. However, there are compilations where each track
# has its own artist. Such compilations usually have "VA" in the title, but not necesserily.
# This script doesn't depend on "VA" mark, but instead it analyzes the tracklist whether
# it contains artists' names or not.
#
# ###################################################################
[Name]=Discogs v2
[BasedOn]=http://www.discogs.com
[IndexUrl]=http://www.discogs.com/artist/
[AlbumUrl]=http://www.discogs.com
[WordSeperator]=+
[IndexFormat]=%_url%|%Album%|%Type%|%Label%|%Year%
[SearchBy]=%artist%
[Encoding]=url-utf-8
[ParserScriptIndex]=...
# ###################################################################
# This script parses the artist's page for all releases
# by this artist.
#
# The output format is defined by IndexFormat above, which
# is used by the selection dialog
# ###################################################################
# Uncomment the following line if you want to write some debug output
#debug "on" "c:\\debug_discogs_A.html" "10"
findline "Releases:"
do
findline ""
sayuntil "<"
say "|"
# Type
findinline "("
sayuntil ")"
say "|"
# Label
moveline 2
joinuntil ""
findinline ">" 2
sayuntil "<"
say "|"
moveline 1
findinline ""
saynextnumber
saynewline
moveline 12
while " "
findinline " | "
if " "
# There is no information about artist in the tracklisting
gotoline 2
findline ""
findinline ""
# Artist
outputto "Artist"
joinuntil ""
regexpreplace "\s{2,}" " "
findinline ""
sayuntil " - "
# Album
outputto "Album"
findline "- "
findinline "- "
sayuntil "<"
# Cover url
outputto "coverurl"
findline ""
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
# Style (all)
outputto "Style"
findline "Style:"
joinuntil ""
killtag "*"
regexpreplace "\s+" " "
findinline "Style:"
sayrest
# Tracks
outputto "tracks"
findline "Tracklisting:"
findline " nowrap"
do
moveline 6
# Title
unspace
if " | | " # emtpy table row!
exit
else
killtag "*"
regexpreplace "\s\(\d?\d:\d\d\)" ""
sayuntil " | "
say "|"
findline " nowrap" 1 1
unspace
endif
while ""
findinline ""
# Album
outputto "Album"
findline "- "
findinline "- "
sayuntil "<"
# Cover url
outputto "coverurl"
findline ""
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
# Style (all)
outputto "Style"
findline "Style:"
joinuntil ""
killtag "*"
regexpreplace "\s+" " "
findinline "Style:"
sayrest
# Artist & Tracks
findline "Tracklisting:"
findline " nowrap"
do
moveline 6
# 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 " nowrap" 1 1
unspace
while " | |