Discogs: Parse Album (Release)


So your script can only be used if you have a local php server? Do you need to download the discogs data first?

Have you seen that discogs has a new API (v2.0) and the old one will be shut down in December?

I hope that doesn't affect you script.


That's correct.
The idea is simple: instead of requesting the data from the final site (discogs, etc) we request the data from a PHP script in our (portable, light) local webserver. The script will get the data from the final site and will give them back (after amending first off course). Check the "discogs new.src" attachment.

There are 2 parts.

  1. IndexUrl
    As you already know and mentioned API 1.0 gives more info vs API 2.0. On top of that API_KEY is not neded in API 1.0 (YES it is true).
    The SearchBy parameter can be enriched now with other tags. Actually every tag/attribute under tag (status, type, title, year, label, format, artist, etc) in API response is filtered from input parameter(s).

  2. AlbumUrl
    Here API 2.0 is really useful.
    The XML is parsed and amended and then returned back.

IndexURL uses API 1.0 because master id is returned instead of all related versions (releases).
Still with a small addition I could request all versions from all master ids found. Maybe will make the response slower but it can be activated by a new parameter in the searchBy.

Please find 3 attachments with step-by-step setup.
:book: the readme file first.
PHP local WEBserver is <40MB in total, portable (no registry, etc) and fully customizable.
I do have a NAS with PHP server pre-installed but the portable server works like a charm.

DetlevD has put in dispute local WEB server security but I don't find a risk there especially if pc is connected to a local router prior to the internet router (like I do).

edit [16/10/2011]:
PHP scripts are organized in class model now.
Version 1.0.0 is released...

I am working on some MusicBrainz PHP scripts too.

discogsVSK_v1.0.0.zip (13.8 KB)

discogsVSK_Artist___otherIDs.src (7.61 KB)


PHP script has some more advantages.
If can combine several searches. E.g. Musicbrainz release does not include directly any artist roles (composer, etc). Instead an additional search must be done. Similar for bandmembers and other song attributes.

It would be nice if .src AlbumParse code is simplified. I.e. all tagnames/tagvalues are provided in "normalized" format from PHP. Then .src doesn't have to bother for a tag source (discogs, musicbrainz, etc).
But it looks like this is technically not feasible now. That would need to provide dynamically (from search result) in outputto

say+++ command (sayuntil, sayregexp, sayrest, etc)
say "|"

Still an alternative would be using if statement. E.g.

findinline "<"
if "albumartist>"
  outputto albumartist
  findinline ">"
  sayuntil "</albumartist>"
if "albumartistsort>"
  outputto albumartistsort
  findinline ">"
  sayuntil "</albumartistsort>" 
if "composer>"
  outputto composer
  findinline ">"
  sayuntil "</composer>" 
while something


The local PHP web server could help on:

  • Filtering artist releases by ANY tag or attribute. e.g. let's say we want to display only "461 Ocean Boulevard" CD releases of eric clapton. API 1.0 discogs url is http://www.discogs.com/artist/eric clapton?releases=1&f=xml The local server based script would be;artist=eric clapton&title=461 Ocean Boulevard&format=CD Tags queried are (artist, title, format). Other tags can be filtered are: Label, Year, id (release id), status (accepted, etc), type (main, etc). No need to amend PHP script for other tags can be returned from API.

    Thus PONE's web source scripts for AlbumArtists could be based on XML format.

  • Executing multiple XML queries. e.g. API 2.0 artist query does not list all releases of master releases but only the main one. Master releases could be extended by additional API queries and return finally mp3tag web source script a single XML.
  • Amending/restructuring final XML XML stream could be even restructured to help mp3tag web source script.


Hi, I'm answering because you pointed me to this.

I don't want to discourage you, but I have to say that your local php web server project is far to complicated for me. I'm reading this topic with some interest, but I can't follow all the technical details.

Moreover, I don't see what you want to achieve by this? Is it just for being able to filter the discogs database in some way.
And do your filters work better than my different search scripts? I have to say that I have really no problems finding discogs entries with my script, I even added a new one for listing master release page entries.
You could easily add some more scripts to my script, based on discogs advanced search: http://www.discogs.com/advanced_search
You can use all tags wich have a search box there, and you don't have to limit in on maximal two tag fields at one search, as my script does at the moment. And you can also use tag field specific search in the standard serach script when you use this keywords: catno:, format:, artist:, label:, country:, track:, style:, as described here: