# ################################################################### # Mp3tag (v2.36+) parsing for discogs.com, created by dano on 2005-05-23 # # Search for ALBUMS only, Various Artists also supported # 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-09-01: updated coverurl fetching # 2005-09-18: updated # 2005-09-19: updated # 2005-10-11: updated Genre, Title and VA # 2005-11-22: updated # 2006-10-07: updated # 2006-01-23: updated by Ydope to get lots more info # 2007-09-02: updated, fields added, merged with an other src (by eric00000007) # ################################################################### [Name]=Discogs_Albums [BasedOn]=http://www.discogs.com [IndexUrl]=http://www.discogs.com/search?type=releases&q="%s"&btn=Go [AlbumUrl]=http://www.discogs.com [WordSeperator]=+ [IndexFormat]=%_url%|%Artist%|%Album%|%Publisher%|%Type%|%Year%| [SearchBy]=%album% [Encoding]=utf-8 [ParserScriptIndex]=... # ################################################################### # I N D E X # ################################################################### #debug "on" "C:\debug.txt" gotoline 2 findline "
    " findline "" say "|" # ARTIST findinline ";\">" sayuntil " - " say "|" # ALBUM movechar 2 sayuntil "" say "|" findline "" moveline 3 unspace while "" findinline "" # Band outputto "band" joinuntil "- " regexpreplace "\s+" " " findinline "<title>" sayuntil "- " # Album outputto "album" findline "- " findinline "- " sayuntil "<" # Coverurl outputto "coverurl" findline "<td valign=top" findinline "<td valign=top" if " align=center>" findinline "<img src=\"" sayuntil "-150-" movechar 4 sayuntil "\"" endif # Publisher outputto "publisher" findline "<tr><td align=right>Label:</td><td>" joinuntil "</td></tr>" killtag "*" regexpreplace "^\s+Label:\s+" "" regexpreplace "\s,\s{2,}" ", " sayrest # Catalog Number outputto "catalog" gotoline 2 findline "<tr><td align=right>Catalog#:</td><td>" joinuntil "</td></tr>" killtag "*" regexpreplace "^\s+Catalog\#:\s+" "" sayrest # COMMENT CATALOG NUMBER outputto "comment catalog number" gotoline 2 findline "<tr><td align=right>Catalog#:</td><td>" joinuntil "</td></tr>" killtag "*" regexpreplace "^\s+Catalog\#:\s+" "" sayrest # Mediatype outputto "Mediatype" findline "<tr><td align=right>Format:</td><td>" joinuntil "</td></tr>" regexpreplace "<[^>]+>" "" regexpreplace "^\s{0,}Format:\s+" "" sayrest # Country: outputto "country" gotoline 2 findline "<tr><td align=right>Country:" killtag "*" findinline ":" movechar 2 sayrest # 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 # Styles outputto "Style" findline "Style:" joinuntil "</tr>" killtag "*" regexpreplace "\s+" " " findinline "Style:" sayrest # Credits outputto "Credits" findline "<tr><td align="right" valign="top">Credits:" 1 1 if " <tr><td align="right" valign="top">Credits:" joinuntil "</tr>" regexpreplace "<br>" "; " killtag "*" regexpreplace "\|+" " " regexpreplace "<[^>]+>" "" regexpreplace "\s+" " " regexpreplace "^\s" "" regexpreplace " ; " ";" regexpreplace ";+" ";" regexpreplace "\s*</tr>\s*$" "" regexpreplace "\s*$" "" regexpreplace ";$" "" regexpreplace "\s+(.)$" "$1" regexpreplace " , " ", " findinline ":" sayrest endif # Notes outputto "Notes" gotoline 2 findline "<tr><td align=right valign=top>Notes:" 1 1 if "<tr><td align=right valign=top>Notes:" joinuntil "</tr>" regexpreplace "<br>" "; " killtag "*" regexpreplace "\|+" " " regexpreplace "<[^>]+>" "" regexpreplace "\s+" " " regexpreplace "^\s" "" regexpreplace " ; " ";" regexpreplace ";+" ";" regexpreplace "\s*</tr>\s*$" "" regexpreplace "\s*$" "" regexpreplace ";$" "" regexpreplace "\s+(.)$" "$1" findinline ":" sayrest endif # Artist & Tracks gotoline 2 findline "Tracklisting:" findline "<td nowrap align="left">" do outputto "VinylNo." killtag "*" regexpreplace "^\s+\d+" "" sayrest say "|" moveline 5 # 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 "<td nowrap align="left">" 1 1 while " <td nowrap align="left">" # End of VA # ############################################################### else gotoline 2 #WWWAUDIOFILE outputto "wwwaudiofile" findline "<a href=\"/release/rat" findinline "/release/rate/" say "http://www.discogs.com/release/" sayuntil "\"" gotoline 2 # discogs-id outputto "discogs-id" findline "<a href=\"/release/rat" findinline "/release/rate/" sayuntil "\"" gotoline 2 findline "<title>" findinline "<title>" # Artist outputto "artist" joinuntil "" regexpreplace "\s{2,}" " " regexpreplace " \(\d\)" "" 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 # Publisher outputto "publisher" findline "<tr><td align=right>Label:</td><td>" joinuntil "</td></tr>" killtag "*" regexpreplace "^\s+Label:\s+" "" regexpreplace "\s,\s{2,}" ", " sayrest # Catalog Number outputto "catalog" gotoline 2 findline "<tr><td align=right>Catalog#:</td><td>" joinuntil "</td></tr>" killtag "*" regexpreplace "^\s+Catalog\#:\s+" "" sayrest # Catalog Number outputto "Comment catalog number" gotoline 2 findline "<tr><td align=right>Catalog#:</td><td>" joinuntil "</td></tr>" killtag "*" regexpreplace "^\s+Catalog\#:\s+" "" sayrest # Mediatype outputto "Mediatype" findline "<tr><td align=right>Format:</td><td>" joinuntil "</td></tr>" regexpreplace "<[^>]+>" "" regexpreplace "^\s{0,}Format:\s+" "" sayrest # Country: outputto "country" gotoline 2 findline "<tr><td align=right>Country:" killtag "*" findinline ":" movechar 2 sayrest # 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 # Styles (all) outputto "styles" findline "Style:" joinuntil "</tr>" killtag "*" regexpreplace "\s+" " " findinline "Style:" sayrest # Credits outputto "Credits" findline "<tr><td align="right" valign="top">Credits:" 1 1 if " <tr><td align="right" valign="top">Credits:" joinuntil "</tr>" regexpreplace "<br>" "; " killtag "*" regexpreplace "\|+" " " regexpreplace "<[^>]+>" "" regexpreplace "\s+" " " regexpreplace "^\s" "" regexpreplace " ; " ";" regexpreplace ";+" ";" regexpreplace "\s*</tr>\s*$" "" regexpreplace "\s*$" "" regexpreplace ";$" "" regexpreplace "\s+(.)$" "$1" regexpreplace " , " ", " findinline ":" sayrest endif # Notes outputto "Notes" gotoline 2 findline "<tr><td align=right valign=top>Notes:" 1 1 if "<tr><td align=right valign=top>Notes:" joinuntil "</tr>" regexpreplace "<br>" "; " killtag "*" regexpreplace "\|+" " " regexpreplace "<[^>]+>" "" regexpreplace "\s+" " " regexpreplace "^\s" "" regexpreplace " ; " ";" regexpreplace ";+" ";" regexpreplace "\s*</tr>\s*$" "" regexpreplace "\s*$" "" regexpreplace ";$" "" regexpreplace "\s+(.)$" "$1" findinline ":" sayrest endif # Tracks findline "Tracklisting:" findline "<td nowrap align="left">" do outputto "VinylNo." killtag "*" regexpreplace "^\s+\d+" "" sayrest say "|" moveline 6 unspace if "<td></td>" # emtpy table row WTF!! exit else killtag "*" regexpreplace "\s\(\d?\d:\d\d\)" "" # Titles outputto "tracks" sayuntil "</td>" say "|" # Mixartist outputto "mixartist" moveline 4 1 if " <tr><td colspan=2>" joinuntil "</small></td>" regexpreplace "<br>" ";<br>" killtag "*" regexpreplace "\s{2,}" " " regexpreplace "\s," "," regexpreplace "\s;" ";" sayrest endif say "|" findline " <td nowrap align="left">" 1 1 endif while " <td nowrap align="left">" endif