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

the TRACK/TOTALTRACK output has quite a few tricky compontents:

1st:
It took me a while to get the numbers in a format which allowed me to repeat the same number for totaltrack after every track number. I solved this with a lot of regexpreplace commands and a do ... while loop.

2nd:
As you know, it is not so easy to write something into the TRACK tag field with mp3tag web sources.
I have described the problem and also the steps to my solution here:
/t/11831/1

Basically it only works when you write rewrite the TITLE and TRACK at the very end of the script. When you do write any other tag-fields after that, the output of the different fields will be mixed up. I have no idea why.

I have used the temp outputs mainly to make the export with different settings easier. With my script you have six different ways (+ three optional changes for scpecial media formats) to write the TRACK field. And you can also write more than one of them into the different fields. So i write them all as normal tag fields in the middle part of the script. They are written direcly in the fields you choose in the settings file. Only if you choose TRACK there, they will be written in TEMP field and copied into TRACK at the end of the script.
There I have:

outputto "title"
sayoutput "tracks"
outputto "track"
sayoutput "discogs pone track / totaltracks temp"
set "discogs pone track / totaltracks temp"

I guess instead of the last two lines you can have every other way to get output. It should also be possilbe to parse the web page here. Only do not send output to a different field than TRACK after that.