# Script for ripping genre, year & record label from beatport.com

**URL:** <https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227>\
**Category:** Web Sources Discussion\
**Created:** [December 3, 2010, 1:16am UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227 "2010-12-03T01:16:56Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [July 31, 2011, 5:50am UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/21 "2011-07-31T05:50:27Z")

</div>

![:blush:](https://community.mp3tag.de/uploads/default/original/1X/c5a064300f7d900a70c2196f6eee95e32dde9b52.gif ":blush:") jaimz i'm sorry. btw trutru what do you think of my suggestions?

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 21, 2011, 6:55pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/22 "2011-08-21T18:55:28Z")

</div>

In a reply to a private mail request I sent jaimz,

As you requested, I have I have gone ahead and changed all I can in the script and I am coming a little stuck now. I’ve attached the script so you can see all the changes made and I’ve put in all the code I want in there. I’ve also put ‘#’’s in there so the script still works and put notes in the script to help you along (that’s if you want to help me) 🙂 so thanks jaimz.

I’m sorry for annoying you but your help here would be invaluable to me!

**WHAT I’VE DONE DO FAR:**

Changed the order of the titles around in the script so they look in order.  
Added this to the search function. Just cuts out all the crap 🙂 got it form pones script. (Thanks pone) BTW I took out the artist lookout and kept just the album.

```
]=$trim($regexp($regexp($repl($regexp(%album%,'(\(|\[).*(\)|\]).*',),-, ,_, ,/, ,:, ,., ,", ,!, ,?, ,&, ), (web|cd *\d*|vinyl|ep|e p ) *$,,1), (web|cd *\d*|vinyl|ep|e p ) *$,,1)

```

DISCNUMBER as "1/1"  
DISCOGS MEDIATYPE as "WEB 320kbps"  
REALEASE TIME as YEAR not DATE  
(Original Mix) to (OM)

**NOT DOING:**

Extended to Xtd

**NEED HELP WITH:**

**ALBUM ARTIST**  
I what the "album artist" to be the same as "albumartist" as traktor reads %album artist% instead. I tried a long time to change the script around but I had no luck.

**WWW** be the url of the release e.g. [http://www.beatport.com/release/serious-remixes/399988](http://www.beatport.com/release/serious-remixes/399988)

Can’t seem to find this in Beatports API.

**DISCOG\_RELEASE ID** be ...s-remixes/399988

I wrote this into the script but it doesn’t seem to work!

```
# BEATPORT RELEASE ID
outputto "discogs_release_id"
findline "<id>"
findinline "<id>"
sayuntil "</"

```

**UNSYNCED LYRICS** be 'Exclusive to [beatport.com](http://beatport.com)' if it’s exclusive  
Beatport says in its API it’s a string like any other such as the release date:

> [@](#):
>
> currentStatus (string): The state of the track on [Beatport.com](http://Beatport.com). Can be any of ["New Release", "Exclusive", "General Content", "Classic"].

Here’s the link to Beatports ‘object structures’ where I seen it.  
[http://api.beatport.com/object-structures.html#id1](http://api.beatport.com/object-structures.html#id1)

I wrote this into the script but it doesn’t seem to work!

```
# NEW RELEASE, EXCLUSIVE, GENERAL CONTENT, CLASSIC
outputto "unsyncedlyrics"
findline "<currentStatus>"
findinline "<currentStatus>"
sayuntil "</"

```

**CATALOG #** add the catalog # to the end of the album like: Serious (Remixes) [MM9330] with closed angle brackets like []

I wrote this into the script but it doesn’t seem to work!

```
# ALBUM
outputto "album"
findline "<name>"
findinline "<name>"
sayuntil "</"
say " ["
findline "<catalogNumber>"
findinline "<catalogNumber>"
sayuntil "</"
say "]"

```

This was my stab at scripting a little and hope its useful to others also..Thanks in advance for your help.

[\_Beatport\_\_Release\_\_\_stevehero\_edit.src](https://community.mp3tag.de/uploads/default/original/2X/4/4483f43012d917d5573e04b6b45e3040d58d1c16.src) (5.23 KB)

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 22, 2011, 9:56am UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/23 "2011-08-22T09:56:21Z")

</div>

> [@stevehero](#):
>
> **NEED HELP WITH:**
> 
> **ALBUM ARTIST**  
> I what the "album artist" to be the same as "albumartist" as traktor reads %album artist% instead. I tried a long time to change the script around but I had no luck.

put this at the end of the script after the

```
outputto "album artist"
 sayoutput "albumartist"

```

> [@stevehero](#):
>
> **WWW** be the url of the release e.g. [http://www.beatport.com/release/serious-remixes/399988](http://www.beatport.com/release/serious-remixes/399988)
> 
> Can’t seem to find this in Beatports API.

put this at any place in the script:

```
outputto "WWW"
  sayoutput "currentpreview"

```

I have put this also inside my own mod of the script. But it seems not work for all releases. Sometime you get a URL to a beatport page that doesn't seem to exist. Like with you example release. It seems as if beatport has put it out of their shop, but still keeps the data in it's API.

If you have a look at the artist page, you will see that "Serious Remixes" is not listed (anymore?).  
[http://www.beatport.com/artist/manufacture...perstars/126978](http://www.beatport.com/artist/manufactured-superstars/126978)  
but the API page is still their:  
[http://api.beatport.com/catalog/releases/d...l&id=399988](http://api.beatport.com/catalog/releases/detail?v=1.0&format=xml&id=399988)

> [@stevehero](#):
>
> **DISCOG\_RELEASE ID** be ...s-remixes/399988

put this at the end of the script:

```
 outputto "discogs_release_id"
 gotoline 1
 findline "<release id="
 findinline "<release id=\""
 sayuntil "\""

```

> [@stevehero](#):
>
> **UNSYNCED LYRICS** be 'Exclusive to [beatport.com](http://beatport.com)' if it’s exclusive  
> Beatport says in its API it’s a string like any other such as the release date:

put this in the tracks loop between \_LENGTH and GENRE (only the part in the Code window. the rest is for you to see where exactly to put it in):

```
outputto "_length"
findline "<trackLength>"
findinline ">"
sayuntil "</"    
say "|"
outputto "unsyncedlyrics"
  findline "<release id="
  findinline " exclusive=\""
  if "true"
      say "Exclusive to beatport.com"
  endif
  say "|"outputto "Genre"
findline "<genre"
joinuntil "</genre>"
findinline "<name>"
sayuntil "</"
say "|

```

> [@stevehero](#):
>
> **CATALOG #** add the catalog # to the end of the album like: Serious (Remixes) [MM9330] with closed angle brackets like []

put this at the end of the script

```
outputto "album"
  say " ["
  sayoutput "catalog #"
  say "]"

```

Why have you changed the original way to write PUBLISHER and CATALOG #?  
Your script doesn't work here. It gets the publisher of the first recommendation link ("Users Also Bought") and the catalog # of the second one at the bottom of the page, not the publisher and the catalog # of the release itself.  
You can fix that by putting  
**gotoline 1**  
before the Publisher and Catalog # part which at your script, or by putting these parts back to their original position at the upper part of the script.

EDIT:  
and for your MMDD date:  
put this after the year part (only the part in the Code window. the rest is for you to see where exactly to put it in):

outputto "year"  
findline ""  
findinline ""  
sayuntil "\</"

```
outputto "date"
   gotochar 1
   findinline "<dateReleased>"
   findinline "-"
   sayuntil "-"
   findinline "-"
   sayuntil "</"

```

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 23, 2011, 12:19am UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/24 "2011-08-23T00:19:28Z")

</div>

Just to let you know I came across a URL which didn't work,  
John Dahlbäcks - Out There [http://www.beatport.com/release/out-there/170967](http://www.beatport.com/release/out-there/170967)  
I thought it was my mod to the script but I referenced it against the original one and it had the same problem.

Everything worked as it should do its just I have a few things I need to ask, simple Q's for you but just to help clear my mind a little!!  
How come the order in which the headings belong is so important?  
Are you a web developer as such or do you need to be in order to do this lark?  
Regards the script is it possible to parse beatport for compilations?  
And I have a further Q down the page regards the "currentStatus (string)" which includes "exlusive, classics etc"

WORKS: Making the "album artist" the same as "albumartist".
QUOTE (pone @ Aug 22 2011, 12:56) \<{POST\_SNAPBACK}\>

put this at the end of the script after the

```
outputto "album artist"
 sayoutput "albumartist"<!--QuoteEnd--></div><!--QuoteEEnd-->

```

WORKS: Adding the Beatport URL to "www". I've tested this out on a couple of albums and no problems as yet. Thanks.
QUOTE (pone @ Aug 22 2011, 12:56) \<{POST\_SNAPBACK}\>

put this at any place in the script:

```
outputto "WWW"
  sayoutput "currentpreview"

```

I have put this also inside my own mod of the script. But it seems not work for all releases. Sometime you get a URL to a beatport page that doesn't seem to exist. Like with you example release. It seems as if beatport has put it out of their shop, but still keeps the data in it's API.

If you have a look at the artist page, you will see that "Serious Remixes" is not listed (anymore?).  
[http://www.beatport.com/artist/manufacture...perstars/126978](http://www.beatport.com/artist/manufacture...perstars/126978)  
but the API page is still their:  
[http://api.beatport.com/catalog/releases/d...l&id=399988](http://api.beatport.com/catalog/releases/d...l&id=399988)

  
**NOTE**  
If you take a look here [http://bit.ly/qtXs3k](http://bit.ly/qtXs3k) on there releases page you'll find it, the page you were referring to is just the artist page which only shows there LATEST RELEASES

WORKS: Adding the id from beatport to the "discogs\_release\_id".
QUOTE (pone @ Aug 22 2011, 12:56) \<{POST\_SNAPBACK}\>

put this at the end of the script:

```
 outputto "discogs_release_id"
 gotoline 1
 findline "<release id="
 findinline "<release id=\""
 sayuntil "\""<!--QuoteEnd--></div><!--QuoteEEnd-->

```

WORKS: Checking if a release is exclusive and adding it to the unsyncedlyrics.

But I was hoping to get the following as beatport has it:  
currentStatus (string): The state of the track on [Beatport.com](http://Beatport.com). Can be any of ["New Release", "Exclusive", "General Content", "Classic"].  
It would be quite handy to refer some tracks as classic because it would make putting playlist together that bit easier.

 
QUOTE (pone @ Aug 22 2011, 12:56) \<{POST\_SNAPBACK}\>

put this in the tracks loop between \_LENGTH and GENRE (only the part in the Code window. the rest is for you to see where exactly to put it in):

```
outputto "_length"
findline "<trackLength>"
findinline ">"
sayuntil "</"    
say "|"
outputto "unsyncedlyrics"
  findline "<release id="
  findinline " exclusive=\""
  if "true"
      say "Exclusive to beatport.com"
  endif
  say "|"outputto "Genre"
findline "<genre"
joinuntil "</genre>"
findinline "<name>"
sayuntil "</"
say "|.<!--QuoteEnd--></div><!--QuoteEEnd-->

```

WORKS: Appends the "catolog #" to the end of the "album" with square brackets.
QUOTE (pone @ Aug 22 2011, 12:56) \<{POST\_SNAPBACK}\>

put this at the end of the script

```
outputto "album"
  say " ["
  sayoutput "catalog #"
  say "]"<!--QuoteEnd--></div><!--QuoteEEnd-->

```

Not sure why I done that to be honest, but I know one thing these scripts are fickle buggers!!! :slight\_smile:

> [@pone](#):
>
> Why have you changed the original way to write PUBLISHER and CATALOG #?  
> Your script doesn't work here. It gets the publisher of the first recommendation link ("Users Also Bought") and the catalog # of the second one at the bottom of the page, not the publisher and the catalog # of the release itself.  
> You can fix that by putting  
> **gotoline 1**  
> before the Publisher and Catalog # part which at your script, or by putting these parts back to their original position at the upper part of the script.

WORKS: Taking the beatport year format YYYY-MM-DD and putting the %date% as MMDD.
QUOTE (pone @ Aug 22 2011, 12:56) \<{POST\_SNAPBACK}\>

and for your MMDD date:

put this after the year part (only the part in the Code window. the rest is for you to see where exactly to put it in):

outputto "year"  
findline ""  
findinline ""  
sayuntil "\</"

```
outputto "date"
   gotochar 1
   findinline "<dateReleased>"
   findinline "-"
   sayuntil "-"
   findinline "-"
   sayuntil "</"<!--QuoteEnd--></div><!--QuoteEEnd-->

```

Thanks once again pone for your help.

######EDIT######  
I've attached the mod version I done with the kind help of @pone. I attached screen shots of it for anyone to see before downloading.  
BTW in case ur wondering how I got the add info screen larger? Photoshop 😛 (Would love that window to resize though!!)

[\_Beatport\_\_Release\_\_\_stevehero\_edit.src](https://community.mp3tag.de/uploads/default/original/2X/8/8786fab2d2e5ee7d09be6a0dfd6ec5f279840448.src) (5.92 KB)

 ![](https://community.mp3tag.de/uploads/default/original/2X/5/568667fbde854b3d42a0bed345d9d2255806e9fd.jpg)  

![](https://community.mp3tag.de/uploads/default/original/2X/9/92dcf187f8cb6c9ba5dda585a0543c52df360867.jpg)

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 23, 2011, 8:14am UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/25 "2011-08-23T08:14:36Z")

</div>

> [@stevehero](#):
>
> Just to let you know I came across a URL which didn't work,  
> John Dahlbäcks - Out There [http://www.beatport.com/release/out-there/170967](http://www.beatport.com/release/out-there/170967)  
> I thought it was my mod to the script but I referenced it against the original one and it had the same problem.

The problem is the missing cover of the release. I stumbled across similar releases. I described the problem here and also present a solution:  
[[ws] beatport.com](https://community.mp3tag.de/t/12325/7)

> [@stevehero](#):
>
> How come the order in which the headings belong is so important?

Because the parsing of the web source always runs from left to right and from up to down. Commands like findline and findinline only look in one direction. If the parser is already behind a certain entry, it will not find it with a simple findline command. So it is a good advice to parse the entries of a document in the order of the document.

There are different sollutions to overcome this.

- **gotoline 1** always sets the parser back to the top of the page
- **gotochar 1** always sets the parser back to the start of the line
- you can search backward with commands like:  
**findinline "whatever" -1  
findline "whatever" -1  
moveline -1**

btw: are you using the **debug** command? Very helpfull to see what exactly the script is doing in every line.

> [@stevehero](#):
>
> Are you a web developer as such or do you need to be in order to do this lark?

No, I'm just a manic music collector with too much time. I learned these things here in the forum and by doing over the last years.

> [@stevehero](#):
>
> Regards the script is it possible to parse beatport for compilations?

What is the problem with compilations? They are parsed like normal releases.  
Do you want a tagfield like COMPIPLATION = 1 for compilations? The problem will be that beatport treats proper compilations in the same way as albums with featuring or remix artists. And I can see nothing like releasetype = single/album/compilation on beatport. So I don't know how to built something in the script which decides if it is a compilation or not.

What can be done is simply to write COMPIPLATION = 1 for every release where VA is put in as albumartist. For that, put that into the script (only the part in the Code window. the rest is for you to see where exactly to put it in):

```
if "<performer ref=\"Artist\""

```

###################CHANGE "VA" TO YOUR LIKING###################

```
    set "albumartist", "VA"

```

###################CHANGE "VA" TO YOUR LIKING###################

```
outputto "compilation"
say "1"endif

```

> [@stevehero](#):
>
> And I have a further Q down the page regards the "currentStatus (string)" which includes "exlusive, classics etc"

Can you give me a release that is marked as "classic"? I have found this status only for tracks, not for a whole release.  
Do you also want "gerneral content" and "new release". Consider, "general content" holds no info at all and "new release" will be outdated a month later.

> [@stevehero](#):
>
> If you take a look here [http://bit.ly/qtXs3k](http://bit.ly/qtXs3k) on there releases page you'll find it, the page you were referring to is just the artist page which only shows there LATEST RELEASES

No, I still can't see it. Only "Serious", not "Serious Remixes". And the link to the releasepage as presented in the API page gives an empty page: [http://www.beatport.com/release/serious-remixes/399988](http://www.beatport.com/release/serious-remixes/399988)

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 23, 2011, 5:33pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/26 "2011-08-23T17:33:41Z")

</div>

> [@pone](#):
>
> The problem is the missing cover of the release. I stumbled across similar releases. I described the problem here and also present a solution:  
> [[ws] beatport.com](https://community.mp3tag.de/t/12325/7)

Maybe beatport will fix this problem at some point, pity they don't have a button to report the page faulty.

> [@pone](#):
>
> Because the parsing of the web source always runs from left to right and from up to down. Commands like findline and findinline only look in one direction. If the parser is already behind a certain entry, it will not find it with a simple findline command. So it is a good advice to parse the entries of a document in the order of the document.
> 
> There are different solutions to overcome this.
> 
> - **gotoline 1** always sets the parser back to the top of the page
> - **gotochar 1** always sets the parser back to the start of the line
> - you can search backward with commands like:  
> **findinline "whatever" -1  
> findline "whatever" -1  
> moveline -1**

Interesting stuff, I shall take note of this. Thanks.

> [@pone](#):
>
> btw: are you using the **debug** command? Very helpful to see what exactly the script is doing in every line.

What do you mean? Is there an application for this?

> [@pone](#):
>
> No, I'm just a manic music collector with too much time. I learned these things here in the forum and by doing over the last years.

So how long has it taken you to get this advanced? Have you any useful links for me to learn more?

QUOTE (pone @ Aug 23 2011, 11:14) \<{POST\_SNAPBACK}\>

What can be done is simply to write COMPILATION = 1 for every release where VA is put in as albumartist. For that, put that into the script (only the part in the Code window. the rest is for you to see where exactly to put it in):

```
if "<performer ref=\"Artist\""

```

###################CHANGE "VA" TO YOUR LIKING###################

```
    set "albumartist", "VA"

```

###################CHANGE "VA" TO YOUR LIKING###################

```
outputto "compilation"
say "1"endif<!--QuoteEnd--></div><!--QuoteEEnd-->

```

Thanks for the COMPILATION workaround.

> [@pone](#):
>
> Can you give me a release that is marked as "classic"? I have found this status only for tracks, not for a whole release.  
> Do you also want "general content" and "new release". Consider, "general content" holds no info at all and "new release" will be outdated a month later.
> 
> No, I still can't see it. Only "Serious", not "Serious Remixes". And the link to the releasepage as presented in the API page gives an empty page: [http://www.beatport.com/release/serious-remixes/399988](http://www.beatport.com/release/serious-remixes/399988)

I just see it stated here, [http://api.beatport.com/object-structures.html#release](http://api.beatport.com/object-structures.html#release) I do not know how to reach a specific albums API, only the examples given.

Your problem seems to be the country your in and you do not have privileges to see that page or more to the point BUY the release. I'm from Ireland I can see the remix version. Don't worry this happens me as well. Cant see why Record labels would want to limit themselves to specific country's!!! ![:huh:](https://community.mp3tag.de/uploads/default/original/1X/f15ee73c0fd9ec3b0db7481f0558638f8ee224ce.gif ":huh:") I've attached a screen shot to your link to prove it IS there.

 ![](https://community.mp3tag.de/uploads/default/original/2X/2/2f095a4f1fd1548c10fe663ca7608bd49eeeb305.jpg)

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 23, 2011, 9:21pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/27 "2011-08-23T21:21:43Z")

</div>

> [@stevehero](#):
>
> (...debug command ...)  
> What do you mean? Is there an application for this?

you can put this command into the script:  
**debug "on" "C:\Users\<user name\>\AppData\Roaming\Mp3tag\data\sources\debug.txt"**

This will give you a textfile which presents:

- the full web source as the script reads it
- a log of what the script is doing in every line. it shows the script line, the script command, the script output (of the last **outputto** command) and the line and position of the parser in the web source.
- shows error messages when something is not found.

you can also use  
**debug "off"**   
at a later part of the script to stop the log at a certain point

You can use **debug** at any point after **[ParserScriptIndex]=...** or/and after **[ParserScriptAlbum]=...**  
 These two sections are seperated for this command. If you use it in **[ParserScriptIndex]=...** it will stop at **[ParserScriptAlbum]=...** You can also use it more then one time in a script when you use different filenames for what I called **debug.txt** E.g. you can you **debug\_index.txt** for the first part and **debug\_album.txt** for the second.

> [@stevehero](#):
>
> So how long has it taken you to get this advanced? Have you any useful links for me to learn more?

I started with my modifications of dano's discogs script like you do with jaimz's. Over the time i came across new problems and ideas, so I learned more by trying to optimize my script. It looked pretty differnt two years ago, at that point it had passages in it which I took from dano without understanding how they work exactly.

There is no special link. I'm sure you already read the help page:  
[https://docs.mp3tag.de/tag-sources](https://docs.mp3tag.de/tag-sources)

And I can see you read parts of the Web Sources Discusssion and the Web Sources Scipts Forums here. I found it helpfull to download other scripts and see how they work. That gave me an understanding of what can be done. I searched a lot in the forum to see if something is explained about special commands. And I simply asked in the forum when I had problems to understand how something works.

Another usefull thing are regular expressions. These are explained here:  
[https://docs.mp3tag.de/actions/replace-regexp](https://docs.mp3tag.de/actions/replace-regexp)  
And in many examples in the forum, mainly to format tag fields. But the principle how they work is the same for web sources scripts.

> [@stevehero](#):
>
> I just see it stated here, [http://api.beatport.com/object-structures.html#release](http://api.beatport.com/object-structures.html#release) I do not know how to reach a specific albums API, only the examples given.

so how have you written the script if you can't see the source?

take the release-number out of the url of the standard html release page and put it at the end of this url to see the API structure:  
[http://api.beatport.com/catalog/releases/d...mat=xml&id=](http://api.beatport.com/catalog/releases/detail?v=1.0&format=xml&id=)

> [@stevehero](#):
>
> Your problem seems to be the country your in and you do not have privileges to see that page or more to the point BUY the release. I'm from Ireland I can see the remix version. Don't worry this happens me as well. Cant see why Record labels would want to limit themselves to specific country's!!! ![:huh:](https://community.mp3tag.de/uploads/default/original/1X/f15ee73c0fd9ec3b0db7481f0558638f8ee224ce.gif ":huh:") I've attached a screen shot to your link to prove it IS there.

Ah, that's another explanation. I think you are right.  
Labels have country specific distirbution deals with different distribution companies. So maybe they have an exclusive deal for Germany with a different web shop.

---

<div class="post-metadata">

**Author:** ![ErwinC](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/db5fbb/32.png) [@ErwinC](https://community.mp3tag.de/u/ErwinC)\
**Post date:** [August 24, 2011, 11:18am UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/28 "2011-08-24T11:18:57Z")

</div>

I was hoping I could search by catalog id of beatport like 2108597  
Thats the most sure way, I'll try to change the script myself but it would be nice if you would implement it...

The link to do that is

[http://api.beatport.com/catalog/tracks?v=1...&id=2108597](http://api.beatport.com/catalog/tracks?v=1.0&format=json&id=2108597)

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 24, 2011, 11:46am UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/29 "2011-08-24T11:46:31Z")

</div>

I can't open your link.  
Anyway, do like this:

Delete everything in the script until **[ParserScriptAlbum]=...** and replace it with this:

```
[Name]=beatport.com
[BasedOn]=http://api.beatport.com
[AlbumUrl]=http://api.beatport.com/catalog/releases/detail?v=1.0&format=xml&id=%s
[SearchBy]=%beatport_release_id%

[ParserScriptAlbum]=...

```

I have used **[SearchBy]=%beatport\_release\_id%**. If you have already stored the ID in another field, insert its name here.

---

<div class="post-metadata">

**Author:** ![ErwinC](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/db5fbb/32.png) [@ErwinC](https://community.mp3tag.de/u/ErwinC)\
**Post date:** [August 24, 2011, 12:00pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/30 "2011-08-24T12:00:35Z")

</div>

getting a error connecting to server [http://api.beatport.com](http://api.beatport.com)

thx for helping me out

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 24, 2011, 12:19pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/31 "2011-08-24T12:19:26Z")

</div>

you have to put a valid beatport release id into the search box, the number in the url like 399988 for this release:  
[http://www.beatport.com/release/serious-remixes/399988](http://www.beatport.com/release/serious-remixes/399988)

---

<div class="post-metadata">

**Author:** ![ErwinC](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/db5fbb/32.png) [@ErwinC](https://community.mp3tag.de/u/ErwinC)\
**Post date:** [August 24, 2011, 12:21pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/32 "2011-08-24T12:21:48Z")

</div>

I see now the solution you gave me is for release (album) id, but I ment track id.

When you download the files each file starts with its own unique track id.  
This id is a 100% sure way to connect the track...

I believe this is the url  
[http://api.beatport.com/catalog/tracks?v=...t=xml&id=%s](http://api.beatport.com/catalog/tracks?v=1.0&format=xml&id=%s)

It finds the track now, but not all data is in the fields.  
All fields are empty except the cover picture...

---

<div class="post-metadata">

**Author:** ![ErwinC](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/db5fbb/32.png) [@ErwinC](https://community.mp3tag.de/u/ErwinC)\
**Post date:** [August 24, 2011, 1:14pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/33 "2011-08-24T13:14:41Z")

</div>

The result xml needs to be parsed differently.  
I'm not really succeding in it ☹

I don't really understand why you don't have this already.  
I always download the wav files from beatport and there is absolutly nothing of meta data in it.  
I used to transform my orderemail data to a txt file and use that in MP3 tag, but not all data is in the email.  
I would like to have the genre in it, and the cover..  
Well as much data as is posible..

I hope you can help me out on this one..

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 24, 2011, 1:15pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/34 "2011-08-24T13:15:42Z")

</div>

> [@Irvin Cee](#):
>
> I see now the solution you gave me is for release (album) id, but I ment track id.
> 
> When you download the files each file starts with its own unique track id.  
> This id is a 100% sure way to connect the track...
> 
> I believe this is the url  
> [http://api.beatport.com/catalog/tracks?v=...t=xml&id=%s](http://api.beatport.com/catalog/tracks?v=1.0&format=xml&id=%s)
> 
> It finds the track now, but not all data is in the fields.  
> All fields are empty except the cover picture...

ok, like for this URL: [http://api.beatport.com/catalog/tracks?v=1...&id=2108597](http://api.beatport.com/catalog/tracks?v=1.0&format=xml&id=2108597)

This seems to be a page for one track only.  
Since the structure it pretty different to a release page, you would need to write a whole new script.  
And you could tag only one track with each script run.

When you have tracks bought from beatport with a track id, aren't these tracks full tagged already?

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 24, 2011, 1:22pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/35 "2011-08-24T13:22:34Z")

</div>

reading your second answer, i understand.  
wav files have no metadata. you transform them into mp3 and want metadata for that.  
well, since the track api is rather simple, it should be possible to write a script for it. but i need some time for that, maybe I'll do it this week.

Can you give me a list of what data you want from the api page in what tag field?

And are ther tracks which list more than one releases at their track id page. Like tracks which appear on a album and on a compilation? If so, how to deal with that?

---

<div class="post-metadata">

**Author:** ![ErwinC](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/db5fbb/32.png) [@ErwinC](https://community.mp3tag.de/u/ErwinC)\
**Post date:** [August 24, 2011, 5:23pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/36 "2011-08-24T17:23:24Z")

</div>

Hi again

I managed to do some good work on it, so I can moge a bit on...

I still would like to have the beatport track ID in the tracknumber but also the "catalog #" tag  
If posible to recup the beatport id from the filename (first part as default by beatport).  
I now first put the id in the "catalog #" tag and let the script read that tag.  
Please not that I changed the & when having 2 artists (or more) in a semicolomn.  
This is more appropriate because some softs like WMP wil then be able to classify this tracks at both artists..

It would be nice I could use this scipt to automatiacly fetch data for x number of tracks.  
Now i need to to 1 at a time ☹

Very much tanks if you wanna look into this.  
I'm very much sure people will apprciate this.

[Name]=[beatport.com](http://beatport.com)  
[BasedOn]=http://api.beatport.com  
[AlbumUrl]=http://api.beatport.com/catalog/tracks?v=1.0&format=xml&id=%s  
[SearchBy]=%catalog #%

[ParserScriptAlbum]=...  
outputto "tracks"  
findline ""  
findinline "\>"  
sayuntil "\</"  
findline ""  
findinline "\>"  
say " ("  
sayuntil "\</"  
say ")|"

outputto "year"  
findline ""  
findinline ""  
sayuntil "\</"

outputto "coverurl"  
findline "width="60" height="60" ref="release""  
moveline 1  
findinline "image url=""  
sayuntil "" "

#outputto "album""  
#findline "\<release exclusive="false""   
#findinline ""  
#sayuntil "\</"

outputto "publisher"  
findline "\<label id"  
findline ""  
findinline ""  
sayuntil "\</"

outputto "genre"  
findline "\<genre id"  
findline ""  
findinline ""  
sayuntil "\</"

outputto "artist"  
findline "\<performer ref="Artist""  
joinuntil ""  
findinline ""  
sayuntil "\</"  
moveline 1  
unspace  
if "\<performer ref="Artist""  
joinuntil ""  
say "; "  
findinline ""  
sayuntil "\</"  
moveline 1  
unspace  
if "\<performer ref="Artist""  
set "albumartist", "Various Artists"  
endif  
endif  
replace "|" "/"

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 24, 2011, 6:04pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/37 "2011-08-24T18:04:44Z")

</div>

> [@pone](#):
>
> you can put this command into the script:  
> **debug "on" "C:\Users\<user name\>\AppData\Roaming\Mp3tag\data\sources\debug.txt"**

Thanks, its all a bit confusing at the min but I'll get it in all good time. I have done what you said and debuged the search by  
release ID you posted in this post [here](https://community.mp3tag.de/t/11227/29) and the returns it sends back are very detailed indeed!

BTW. I used your code:

```
[Name]=beatport.com
[BasedOn]=http://api.beatport.com
[AlbumUrl]=http://api.beatport.com/catalog/releases/detail?v=1.0&format=xml&id=
[SearchBy]=%discogs_release_id%

[ParserScriptAlbum]=...

```

The **Release** : _371080_ is coming back with unfavoured results.

Its coming back with:  
**Artist:** Red Carpet, Marcus Schossow  
**AlbumArtist** : Artist: Red Carpet **&** Marcus Schossow  
**Album Artist** : Artist: Red Carpet **&** Marcus Schossow  
**Title** : Alright 2011 feat. Marcus Schossow **((Marcus Schossow Remix))  
www**: [http://api.beatport.com/catalog/releases/d...l&id=371080](http://api.beatport.com/catalog/releases/detail?v=1.0&format=xml&id=371080) for which I'd like the main URL

I would like to know how to change the Album Artist to match that of the Artist with a ", " I tried modifing the code:

```
moveline 1
unspace
if "<performer ref=\"Artist\""
joinuntil "</performer>"
say ", "
findinline "<name>"<PERFORMER performer ?

```

But this didn''t have the desired results. Its fine once the album goes over 3 artists then album artist becomes "VA" but having only two artists I want the " & " sign to become ", " and the **title** : Alright 2011 feat. Marcus Schossow **((Marcus Schossow Remix))** is not right. I'm not sure the reason for this.

> [@pone](#):
>
> I started with my modifications of dano's discogs script like you do with jaimz's.  
> There is no special link. I'm sure you already read the help page:  
> https://docs.mp3tag.de/tag-sources

Your script has developed so much and thanks for that. The export thing was a stroke for genious. 🙂

> [@pone](#):
>
> so how have you written the script if you can't see the source?

Dunno really, but I have not really done much scripting it was all really simple stuff I have done so far but until I get a better understanding of it all then I'll just have to make do with pickin peoples brains on here!

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 24, 2011, 8:45pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/38 "2011-08-24T20:45:31Z")

</div>

> [@stevehero](#):
>
> The **Release** : _371080_ is coming back with unfavoured results.
> 
> Its coming back with:  
> **Artist:** Red Carpet, Marcus Schossow  
> **AlbumArtist** : Artist: Red Carpet **&** Marcus Schossow  
> **Album Artist** : Artist: Red Carpet **&** Marcus Schossow  
> **Title** : Alright 2011 feat. Marcus Schossow **((Marcus Schossow Remix))  
> www**: [http://api.beatport.com/catalog/releases/d...l&id=371080](http://api.beatport.com/catalog/releases/detail?v=1.0&format=xml&id=371080) for which I'd like the main URL

Here is the main URL:  
[http://www.beatport.com/release/alright-2011/371080](http://www.beatport.com/release/alright-2011/371080)  
You get that by clicking on the preview button down left at the web sources dialog windows.

QUOTE (stevehero @ Aug 24 2011, 22:04) \<{POST\_SNAPBACK}\>

I would like to know how to change the Album Artist to match that of the Artist with a ", " I tried modifing the code:

```
moveline 1
          unspace
          if "<performer ref=\"Artist\""
          joinuntil "</performer>"
          say ", "
          findinline "<name>"<PERFORMER performer ?

```

But this didn''t have the desired results. Its fine once the album goes over 3 artists then album artist becomes "VA" but having only two artists I want the " & " sign to become ", " and the **title** : Alright 2011 feat. Marcus Schossow **((Marcus Schossow Remix))** is not right. I'm not sure the reason for this.

I discovered the difference of artist and albumartist at many releases. I have solved this with an action group which I use after the web script i such cases. This also puts "artist 1, artist 2, artist 3" to "artist 1, artist 2 and artist 3":

Action 1: **Format Value**  
Field: **ARTIST**  
Formatstring: **$regexp(%artist%,', ([^,]+)$',' & $1 ')**  
   
Action 2: **Format Valu** e  
Field: **MIXARTIST**  
Formatstring: **$regexp(%mixartist%,', ([^,]+)$',' & $1 ')**

But now as I dig deeper into that beatport script, I see it's easy to change inside the script:  
change this:

```
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->outputto "Artist"
 sayregexp "(?<=<Artist>)[^<]+" <b>", "</b> "</track>"
 say "|"<!--fontc--></span><!--/fontc-->

```

into this:

```
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->outputto "Artist"
 sayregexp "(?<=<Artist>)[^<]+" <b>" & "</b> "</track>"
 say "|"<!--fontc--></span><!--/fontc-->

```

But that won't do the ..., ... & ... trick for three or more artists.  
Here is a usefull threat on that freacky sayregxp command: [/t/6993/1](https://community.mp3tag.de/t/6993/1)

For the ((Mixname)) thing: It seems that the beatport API page is somehow ill-formated. It has  
**(**Marcus Schossow Remix**)**  
where it normally should have  
Marcus Schossow Remix

We can fix that with a regexpreplace command (the bold line is new):

```
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->outputto "tracks"
 findline "<name>"
 findinline ">"
 sayuntil "</"
 findline "<mixName>"

```

**regexpreplace "(([^\<]+))" "$1"**

```
 findinline ">"<!--fontc--></span><!--/fontc-->

```

p.s.:  
As you asked me for links at hints, I have forgotten to mention the very usefull freeware notepad++. It's like notedpad, but with plus plus more options and possibilities. It also refreshes the debug files when it is rewritten if you watch it with this tool:  
[http://notepad-plus-plus.org/](http://notepad-plus-plus.org/)  
For this exists is an also very usefull language extension for the mp3tag web sources script language which highligts the comands of the script for a better overview. That helps to avoid typos, because you see they don't have the correct colour:  
[Web Sources Framework: Help needed](https://community.mp3tag.de/t/10944/8)

p.p.s:  
I'm sorry. I didn't read your post carefully enough. I changed the , & artist albumartist thing exactly the other way around as you wanted it. For your desired solution you started right with replacing

say " & "

with

say ", "

at albumartist. And that is all what is necessary. You have also changed the next line (at least in the code you presented in your post). That would normally result into a Adjust Album Information window with all tag fields empty, because the line doesn't fit into the web sources syntax.

p.p.p.s:  
Sorry, I also didn't understand your www problem. Here is the code for getting the main url when currentpreview is not available (as it is the case when you skip the [ParserScriptIndex]=... Part):

outputto "WWW"

gotoline 1  
findline ""  
findinline ""  
say "[http://www.beatport.com/release/](http://www.beatport.com/release/)"  
sayuntil ""  
say "/"  
sayoutput "discogs\_release\_id"

---

<div class="post-metadata">

**Author:** ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)\
**Post date:** [August 24, 2011, 11:30pm UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/39 "2011-08-24T23:30:32Z")

</div>

> [@Irvin Cee](#):
>
> I still would like to have the beatport track ID in the tracknumber but also the "catalog #" tag

so i would advice you to use a different tag field for the beatport track ID, as this is something different as the catalog #.  
But there seems to be no catalog # in the track-api-page. Only the beatport release id from where the track is taken from. You would have to do an additional run of a script for releases to to get the catalog #.

> [@Irvin Cee](#):
>
> If posible to recup the beatport id from the filename (first part as default by beatport).

Yes. The tracknames are like trackid\_title\_name\_mix\_name.mp3, right? This will give you the frist numbers of the filename:

[SearchBy]=$regexp(%\_filename%,^(\d+).+,$1)

> [@Irvin Cee](#):
>
> Please not that I changed the & when having 2 artists (or more) in a semicolomn.  
> This is more appropriate because some softs like WMP wil then be able to classify this tracks at both artists..

The proper way to write multivalue tags in Mp3tag is to use \\ as a seperator. But this has some points you have to do right:  
You have to write **say "\\"** to get **\\**.  
And you have to save the files a second time after using the script to get the tag seperated.  
see here: [/t/9432/1](https://community.mp3tag.de/t/9432/1)  
But if "; " works for you as a workaround, you can stick to this.

> [@Irvin Cee](#):
>
> It would be nice I could use this scipt to automatiacly fetch data for x number of tracks.  
> Now i need to to 1 at a time ☹

Here was a project to get this done. Don't know if it works. Tested it a while ago and didn't get it going. Produced a system crash after serveral trys. Now it says "project stopped" in the first post.  
[/t/6702/1](https://community.mp3tag.de/t/6702/1)

Your script generally works nice. Good work!

If you replace

outputto "tracks"

with

outputto "title"

you don't get that track number which will be always 1 for a script for one file.

p.s.:  
and here is a working code to get the album name:

outputto "album"

findline "\<release id="  
joinuntil ""  
findinline ""  
sayuntil ""

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 25, 2011, 4:31am UTC](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227/40 "2011-08-25T04:31:41Z")

</div>

> [@](#):
>
> You get that by clicking on the preview button down left at the web sources dialog windows.

I fixed the problem myself in the mean time. This was my first bit of scripting and it was quite enjoyable seeing it work. 🙂 As much!

> [@](#):
>
> As you asked me for links at hints, I have forgotten to mention the very usefull freeware notepad++

Thanks I see straight away its got a tab feature which is cool in itself and has style coding too. BTW what BB code editor is the best for posting to this forum. I'm using WYSIWYG BBCode Editor, [http://wysiwygbbcode.codeplex.com/](http://wysiwygbbcode.codeplex.com/) pretty handy tool but it doesnt have spell check.

> [@](#):
>
> You have also changed the next line (at least in the code you presented in your post)

I will attached my lastest copy of the script so you can point out to me where I went wrong.

**ADDITIONAL** :  
I see this within the script:  
regexpreplace "\>\s+\<" "\>\<" basically in scripting it replaces all white spaces inside \>\< (non greedy) to "BLANK"?

I've gone against the idea about tagging the 'exclusive to [beatport.com](http://beatport.com)' and instead what the description of the release there just like you have with the Discogs one.I've tried to code this below can't see what I am doing wrong? Unless it a multi line issue within the API?

```
# UNSYNCED LYRICS
outputto "unsyncedlyrics"
findline "<description>"
findinline "<description>"
sayuntil "</"

```

I have changed the 'coverurl' because I wanted to learn but am now curiuos to know can you add an if command to the ~ COVERURL then you search findline "width="60" height="60" ref="" instead?

```
# COVERURL
outputto "coverurl"
findline "width="500" height="500""
gotochar 1
findinline "url=\""
sayuntil "\" "

# COVERURL PROBLEM
outputto "coverurl"
findline "width=\"60\" height=\"60\" ref=\""
moveline 1
findinline "url=\""
sayuntil "\" "

```

[\_Beatport\_stevehero\_\_Release.src](https://community.mp3tag.de/uploads/default/original/2X/b/bf6c798e7caa2b6b0704cc3ef701a68ffaa2c0c5.src) (5.75 KB)

[Previous page](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227.md?page=1)

[Next page](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227.md?page=3)
