# ######################################################################## # Mp3tag (v2.42 or higher) parsing for discogs.com, created by TerzOpperator on 2008-10-08 # # Search for RELEASES only! # This file should be in your sources directory. # On Windows XP it's: # C:\Documents and Settings\*username*\Application Data\Mp3tag\data\sources # # On Windows Vista it's: # C:\Users\*username*\AppData\Roaming\Mp3tag\data\sources # # # Uses the artist and title to find an release # # Modifications: # 2008-10-08: First Release of this Script - tested with version 2.41 # 2008-10-10: Added: Tag for check if it is a Compilation (For a better Tag To File Action) # 2008-10-10: Not an Script update, but see the Action Update below. # 2008-14-10: Fixed: Remix Bug @ Script # 2008-29-10: Fixed: Date if Discogs have only the Day and Month only (now we will get all Date Formats from Discogs ;)) # 2009-08-03: Script: Version 1.5.0 # Script: fully recoded and now uses the discogs API # Script: renamed discogs.src is now: discogsapi4djs-at.src # Added: Windows Vista description in this file # Added: Script Version in the description # Changed:[Name] - For the future / other scripts # Added: [IndexURL], [WordSeperator], [SearchBy], [Encoding] # Added: Now you can search by Artist & Album to find a release in this script # Fixed: Now detecting remixer and mixartist correctly this was a very bad bug before # e.g. DiscogsID:355807 = Schranz Total 9 and Mixartist now is =Boris S. (Credits) # Added: iTunes Tags: BAND (If the there are different Track-Artists and the "Main" is not Various, # ITUNESCOMPILATION (if its a Compilation) - i think you know what it is. ;) # Result: Fully iTunes integration / Album / Compilation / CoverFlow # # ######################################################################## [Name]=Discogs Release for Deejay's - Album & Title search [BasedOn]=http://www.discogs.com [IndexUrl]=http://www.discogs.com/search?type=releases&q=%s&f=xml&api_key=e23cf6161b [AlbumUrl]=http://www.discogs.com/release/ [WordSeperator]=+ [IndexFormat]=%Release%|%_url%|%_preview%|%Comment% [SearchBy]=%artist% %album% [Encoding]=UTF-8 [ParserScriptIndex]=... #Debug "on" "C:\debug.txt" # ######################################################################## # This script parses the discogs api for all releases # by this artist and albumname. # # The output format is defined by IndexFormat above, which # is used by the selection dialog # ######################################################################## # Join Lines JoinUntil "" # Result do findinline ")[^<]+(?=)" ", " "" say "|" #URL-Release sayregexp "(?<=release/)[^<]+(?=)" ", " "" say "?f=xml&api_key=e23cf6161b" say "|" #URL-Preview sayregexp "(?<=)[^<]+(?=)" ", " "" say "|" # Comment sayregexp "(?<=)[^<]+(?=)" ", " "" saynewline findinline "" while "" # Format XML (Converting to UTF-8) regexpreplace """ "\"" regexpreplace "&" "&" regexpreplace "'" "'" # DiscogsID outputto "DiscogsID" findinline "" # Coverurl outputto "coverurl" if "" findinline "uri=\"" sayuntil "\" uri" findinline "" endif #Artist or BAND Tag - (first) if "" findinline "" # Set to Compilation if Various if "Various" outputto "isCompilation" say "yes" outputto "ITUNESCOMPILATION" say "1" else # oh my god. ok, skip to i hope it exists... ;) findinline "" if "" findinline "" endif if "" findinline "" endif # check if there are track artists if "" # first get hack to here findinline "" -1 findinline "" -1 findinline "" # now set ONLY the BAND TAG for iTunes do outputto "BAND" findinline "" movechar -8 if ")" # Split Artist findinline "" -1 sayregexp "(?<=)[^<]+(?= \()" ", " "" else findinline "" -1 sayregexp "(?<=)[^<]+(?=)" ", " "" endif findinline "" if "" findinline "" endif if "" say " " sayregexp "(?<=)[^<]+(?=)" ", " "" say " " endif findinline "" while "" else # first get hack to here findinline "" -1 findinline "" -1 findinline "" # now set ONLY the "Main" Artist TAG (no other Artists Exists) do outputto "Artist" findinline "" movechar -8 if ")" # Split Artist findinline "" -1 sayregexp "(?<=)[^<]+(?= \()" ", " "" else findinline "" -1 sayregexp "(?<=)[^<]+(?=)" ", " "" endif findinline "" if "" findinline "" endif if "" say " " sayregexp "(?<=)[^<]+(?=)" ", " "" say " " endif findinline "" while "" endif endif findinline "" endif # Album outputto "Album" if "" findinline "<title>" sayuntil "" findinline "" endif # CatalogID and Publisher if "" # CatalogID outputto "CatalogID" findinline "" sayregexp "(?<=" endif # Mixartists if "" #outputto "Mixartist" findinline "" if "" do findinline "" if "" findinline "" endif if "" findinline "" endif if "" findinline "" if "DJ Mix" findinline "" -1 outputto "Mixartist" findinline "" movechar -8 if ")" # Split Mixartist findinline "" -1 sayregexp "(?<=)[^<]+(?= \()" ", " "" else findinline "" -1 sayregexp "(?<=)[^<]+(?=)" ", " "" endif findinline "" if "" #findinline "" say " (" sayregexp "(?<=)[^<]+(?=)" ", " "" say ")" findinline "" findinline "" -1 else findinline "" -1 endif say ", " endif findinline "" endif findinline "" while "" endif findinline "" endif # Check Compilation if "" findinline "" if "" endif if "" # Checking Format Descriptions (is it a Compilation) do findinline "" if "Compilation" outputto "isCompilation" set "isCompilation" "yes" outputto "ITUNESCOMPILATION" set "ITUNESCOMPILATION" "1" endif #saynewline findinline "" while "" endif findinline "" endif # API - (skip and use style as genre) if "" findinline "" endif # Style - Output as Genre (Default normally is Genre as Genre, but i think this is a little bit more information and it's cool 4 DJing) ;) if "" outputto "Genre" do findinline "" #saynewline findinline "" if "