# ################################################################### # 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 "<a href=\"" findinline "<a href=\"" sayuntil "\"" say "|" # Album findinline ">" sayuntil "<" say "|" # Type findinline "(" sayuntil ")" say "|" # Label moveline 2 joinuntil "</td>" findinline ">" 2 sayuntil "<" say "|" moveline 1 findinline "<td>" saynextnumber saynewline moveline 12 while " <a href=" 500 [ParserScriptAlbum]=... # ################################################################### # This script parses the albums page for all common information. # # The current output variable is set via the outputto command # All these fields are used by the confirm online information dialog # ################################################################### # Uncomment the following line if you want to write some debug output debug "on" "c:\\debug_discogsB.html" # Check if artist is present in tracklisting findline "Tracklisting:" findline "<td nowrap" findinline "<td nowrap" findline "<td>" findinline "<td>" if " " # There is no information about artist in the tracklisting gotoline 2 findline "<title>" findinline "<title>" # Artist outputto "Artist" joinuntil "" regexpreplace "\s{2,}" " " findinline "" sayuntil " - " # Album outputto "Album" findline "- " findinline "- " sayuntil "<" # Cover url outputto "coverurl" findline "<td valign=top" findinline "<td valign=top" if " align=center>" findinline "<img src=\"" sayuntil "-150-" movechar 4 sayuntil "\"" endif # Year outputto "Year" findline "Released:" findinline "<td>" # 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 "</tr>" killtag "*" regexpreplace "\s+" " " regexpreplace "\s+$" "" regexpreplace ",\s\w+$" "" findinline "Genre:" sayrest # Style (all) outputto "Style" findline "Style:" joinuntil "</tr>" killtag "*" regexpreplace "\s+" " " findinline "Style:" sayrest # Tracks outputto "tracks" findline "Tracklisting:" findline " nowrap" do moveline 6 # Title unspace if "<td></td>" # emtpy table row! exit else killtag "*" regexpreplace "\s\(\d?\d:\d\d\)" "" sayuntil "</td>" say "|" findline " nowrap" 1 1 unspace endif while "<td " else # There is information about artist in the tracklisting gotoline 2 findline "<title>" findinline "<title>" # Album outputto "Album" findline "- " findinline "- " sayuntil "<" # Cover url outputto "coverurl" findline "<td valign=top" findinline "<td valign=top" if " align=center>" findinline "<img src=\"" sayuntil "-150-" movechar 4 sayuntil "\"" endif # Year outputto "Year" findline "Released:" findinline "<td>" # 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 "</tr>" killtag "*" regexpreplace "\s+" " " regexpreplace "\s+$" "" regexpreplace ",\s\w+$" "" findinline "Genre:" sayrest # Style (all) outputto "Style" findline "Style:" joinuntil "</tr>" killtag "*" regexpreplace "\s+" " " findinline "Style:" sayrest # Artist & Tracks findline "Tracklisting:" findline " nowrap" do moveline 6 # Artist outputto "Artist" joinuntil "</td>" killtag "*" regexpreplace "\s{2,}" " " sayrest say "|" findline "<td>" # Title outputto "Tracks" unspace killtag "*" regexpreplace "\s\(\d?\d:\d\d\)" "" sayuntil "</td>" say "|" findline " nowrap" 1 1 unspace while "<td " endif