# 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:** 1
**Showing post:** 38

<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"

---

_[View the full topic](https://community.mp3tag.de/t/script-for-ripping-genre-year-record-label-from-beatport-com/11227)._
