IPB

Welcome Guest ( Log In | Register )

5 Pages V  « < 3 4 5  
Reply to this topicStart new topic
> Script for ripping genre, year & record label from beatport.com
stevehero
post Nov 8 2011, 02:12
Post #61


Member


Group: Full Members
Posts: 573
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.65



QUOTE (pone @ Sep 6 2011, 12:40) *
Well, I quickly adapted my script from discogs and it seems to be working. Add this at the end of the script:

CODE
#TOTALTRACKS    
outputto "TOTALTRACKS"
gotoline 1
joinuntil "<name>Users Also Bought</name>"
regexpreplace "</track>" "<<<Track>>>I<<<Track>>>"
regexpreplace ".*?(<<<Track>>>.*<<<Track>>>).*" "$1"
regexpreplace "<<<Track>>>[^I].*?<<<Track>>>" "<<<Track>>>"
replace "<<<Track>>>" ""
replace "IIIIIIIIII" "X"
replace "XXXXXXXXXX" "C"
replace "CI" "C0I"
regexpreplace "X$" "X0"
regexpreplace "C$" "C00"
replace "CCCCCCCCC" "9"
replace "CCCCCCCC" "8"
replace "CCCCCCC" "7"
replace "CCCCCC" "6"
replace "CCCCC" "5"
replace "CCCC" "4"
replace "CCC" "3"
replace "CC" "2"
replace "C" "1"
replace "XXXXXXXXX" "9"
replace "XXXXXXXX" "8"
replace "XXXXXXX" "7"
replace "XXXXXX" "6"
replace "XXXXX" "5"
replace "XXXX" "4"
replace "XXX" "3"
replace "XX" "2"
replace "X" "1"
replace "IIIIIIIII" "9"
replace "IIIIIIII" "8"
replace "IIIIIII" "7"
replace "IIIIII" "6"
replace "IIIII" "5"
replace "IIII" "4"
replace "III" "3"
replace "II" "2"
replace "I" "1"
sayrest

I was looking at your mod on your 3.11 version. I was trying to figure out how you implemented the TRACK/TOTALTRACK output. It seems that you have outputted the TRACK and TOTALTRACKS to temp tags then outputted them to the actual tag. Could you help me understand how I would go about implementing this in my scripts?

Thanks.


--------------------
▶✚♬ ═‎​ ♡
Go to the top of the page
 
+Quote Post
pone
post Nov 8 2011, 03:19
Post #62


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



ZITAT(stevehero @ Nov 8 2011, 02:12) *
I was looking at your mod on your 3.11 version. I was trying to figure out how you implemented the TRACK/TOTALTRACK output. It seems that you have outputted the TRACK and TOTALTRACKS to temp tags then outputted them to the actual tag. Could you help me understand how I would go about implementing this in my scripts?

Thanks.


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:
http://forums.mp3tag.de/index.php?showtopic=13359

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:
QUELLTEXT
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.
Go to the top of the page
 
+Quote Post
stevehero
post Nov 8 2011, 14:36
Post #63


Member


Group: Full Members
Posts: 573
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.65



QUOTE (pone @ Nov 8 2011, 02:19) *
I guess instead of the last two lines you can have every other way to get output. It should also be possible to parse the web page here. Only do not send output to a different field than TRACK after that.

Here is the code I have put below the code in your post here.
CODE
# TRACK/TOTALTRACKS
outputto "title"
sayoutput "tracks"
outputto "track"
say "01|02|03|04|05|06|07|08|09|"
say "/"
sayoutput "totaltracks"

It puts leading zeros in okay but when I do the last two lines above they don't work. You said as long as I dont output to any other field than TRACK it will be okay. I've also tried parsing the website as you mentioned by adding this code but no joy.
CODE
outputto "title"
sayoutput "tracks"
outputto "track"
say "01|02|03|04|05|06|07|08|09|"
say "/"
gotoline 1
joinuntil "<name>Users Also Bought</name>"
regexpreplace "</track>" "<<<Track>>>I<<<Track>>>"
regexpreplace ".*?(<<<Track>>>.*<<<Track>>>).*" "$1"
regexpreplace "<<<Track>>>[^I].*?<<<Track>>>" "<<<Track>>>"
replace "<<<Track>>>" ""
replace "IIIIIIIIII" "X"
replace "XXXXXXXXXX" "C"
replace "CI" "C0I"
regexpreplace "X$" "X0"
regexpreplace "C$" "C00"
replace "CCCCCCCCC" "9"
replace "CCCCCCCC" "8"
replace "CCCCCCC" "7"
replace "CCCCCC" "6"
replace "CCCCC" "5"
replace "CCCC" "4"
replace "CCC" "3"
replace "CC" "2"
replace "C" "1"
replace "XXXXXXXXX" "9"
replace "XXXXXXXX" "8"
replace "XXXXXXX" "7"
replace "XXXXXX" "6"
replace "XXXXX" "5"
replace "XXXX" "4"
replace "XXX" "3"
replace "XX" "2"
replace "X" "1"
replace "IIIIIIIII" "9"
replace "IIIIIIII" "8"
replace "IIIIIII" "7"
replace "IIIIII" "6"
replace "IIIII" "5"
replace "IIII" "4"
replace "III" "3"
replace "II" "2"
replace "I" "1"
sayrest


--------------------
▶✚♬ ═‎​ ♡
Go to the top of the page
 
+Quote Post
pone
post Nov 8 2011, 14:55
Post #64


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



ZITAT(stevehero @ Nov 8 2011, 14:36) *
.
QUELLTEXT
# TRACK/TOTALTRACKS
outputto "title"
sayoutput "tracks"
outputto "track"
say "01|02|03|04|05|06|07|08|09|"
say "/"
sayoutput "totaltracks"


have a look a the debug file. this can't work it will give you the output:
"01|02|03|04|05|06|07|08|09|/15" (15 as example for totaltracks)

but you need:
"01/15|02/15|03/15|04/15|05/15|06/15|07/15|08/15|09/15|10/15|11/15|12/15..."

this has nothing to do with the TRACK vs TRACKS problem. it's the the tricky thing I refered above under 1st.
pleas note that i have done some changes that total-tracks-counter with the roman numbers.
this is the core element of what I have changed.
QUELLTEXT
do                                                    # get seperated tracknumbers
    regexpreplace "^(I)(I+)" "$2|$1$2"
    findinline "I"
while "I"


gives me something like
15|14|13|12|11|10...
or was it
1|2|3|4|5|6...

don't know now. more tonight. I don't have the time now
Go to the top of the page
 
+Quote Post
stevehero
post Nov 8 2011, 15:30
Post #65


Member


Group: Full Members
Posts: 573
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.65



QUOTE (pone @ Nov 8 2011, 13:55) *
but you need:
"01/15|02/15|03/15|04/15|05/15|06/15|07/15|08/15|09/15|10/15|11/15|12/15..."

To be honest I'm completely baffled how to get this to work. So any further help would be appreciated.


--------------------
▶✚♬ ═‎​ ♡
Go to the top of the page
 
+Quote Post
pone
post Nov 9 2011, 02:02
Post #66


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



ZITAT(stevehero @ Nov 8 2011, 15:30) *
To be honest I'm completely baffled how to get this to work. So any further help would be appreciated.


You still don't use the debug file, do you? You can see there every step the script does.

Well,
here is what I used in 3.9 for TRACK/TOTALTRACK.
CODE
outputto "title"
sayoutput "tracks"
outputto "track"
say "01/"
sayoutput "discogs pone totaltracks temp"
say "|02/"
sayoutput "discogs pone totaltracks temp"
say "|03/"
sayoutput "discogs pone totaltracks temp"
say "|04/"
sayoutput "discogs pone totaltracks temp"
say "|05/"
sayoutput "discogs pone totaltracks temp"
say "|06/"
sayoutput "discogs pone totaltracks temp"
say "|07/"
sayoutput "discogs pone totaltracks temp"
say "|08/"
sayoutput "discogs pone totaltracks temp"
say "|09/"
sayoutput "discogs pone totaltracks temp"
say "|10/"
sayoutput "discogs pone totaltracks temp"
say "|11/"
sayoutput "discogs pone totaltracks temp"
say "|12/"
sayoutput "discogs pone totaltracks temp"
say "|13/"
sayoutput "discogs pone totaltracks temp"
say "|14/"
sayoutput "discogs pone totaltracks temp"
say "|15/"
sayoutput "discogs pone totaltracks temp"
say "|16/"
sayoutput "discogs pone totaltracks temp"
say "|17/"
sayoutput "discogs pone totaltracks temp"
say "|18/"
sayoutput "discogs pone totaltracks temp"
say "|19/"
sayoutput "discogs pone totaltracks temp"
say "|20/"
sayoutput "discogs pone totaltracks temp"
say "|21/"
sayoutput "discogs pone totaltracks temp"
say "|22/"
sayoutput "discogs pone totaltracks temp"
say "|23/"
sayoutput "discogs pone totaltracks temp"
say "|24/"
sayoutput "discogs pone totaltracks temp"
say "|25/"
sayoutput "discogs pone totaltracks temp"
say "|26/"
sayoutput "discogs pone totaltracks temp"
say "|27/"
sayoutput "discogs pone totaltracks temp"
say "|28/"
sayoutput "discogs pone totaltracks temp"
say "|29/"
sayoutput "discogs pone totaltracks temp"
say "|30/"
sayoutput "discogs pone totaltracks temp"
say "|31/"
sayoutput "discogs pone totaltracks temp"
say "|32/"
sayoutput "discogs pone totaltracks temp"
say "|33/"
sayoutput "discogs pone totaltracks temp"
say "|34/"
sayoutput "discogs pone totaltracks temp"
say "|35/"
sayoutput "discogs pone totaltracks temp"
say "|36/"
sayoutput "discogs pone totaltracks temp"
say "|37/"
sayoutput "discogs pone totaltracks temp"
say "|38/"
sayoutput "discogs pone totaltracks temp"
say "|39/"
sayoutput "discogs pone totaltracks temp"
say "|40/"
sayoutput "discogs pone totaltracks temp"
say "|41/"
sayoutput "discogs pone totaltracks temp"
say "|42/"
sayoutput "discogs pone totaltracks temp"
say "|43/"
sayoutput "discogs pone totaltracks temp"
say "|44/"
sayoutput "discogs pone totaltracks temp"
say "|45/"
sayoutput "discogs pone totaltracks temp"
say "|46/"
sayoutput "discogs pone totaltracks temp"
say "|47/"
sayoutput "discogs pone totaltracks temp"
say "|48/"
sayoutput "discogs pone totaltracks temp"
say "|49/"
sayoutput "discogs pone totaltracks temp"
say "|40/"
sayoutput "discogs pone totaltracks temp"
say "|41/"
sayoutput "discogs pone totaltracks temp"
say "|42/"
sayoutput "discogs pone totaltracks temp"
say "|43/"
sayoutput "discogs pone totaltracks temp"
say "|44/"
sayoutput "discogs pone totaltracks temp"
say "|45/"
sayoutput "discogs pone totaltracks temp"
say "|46/"
sayoutput "discogs pone totaltracks temp"
say "|47/"
sayoutput "discogs pone totaltracks temp"
say "|48/"
sayoutput "discogs pone totaltracks temp"
say "|49/"
sayoutput "discogs pone totaltracks temp"
say "|60/"
sayoutput "discogs pone totaltracks temp"
say "|61/"
sayoutput "discogs pone totaltracks temp"
say "|62/"
sayoutput "discogs pone totaltracks temp"
say "|63/"
sayoutput "discogs pone totaltracks temp"
say "|64/"
sayoutput "discogs pone totaltracks temp"
say "|65/"
sayoutput "discogs pone totaltracks temp"
say "|66/"
sayoutput "discogs pone totaltracks temp"
say "|67/"
sayoutput "discogs pone totaltracks temp"
say "|68/"
sayoutput "discogs pone totaltracks temp"
say "|69/"
sayoutput "discogs pone totaltracks temp"
say "|70/"
sayoutput "discogs pone totaltracks temp"
say "|71/"
sayoutput "discogs pone totaltracks temp"
say "|72/"
sayoutput "discogs pone totaltracks temp"
say "|73/"
sayoutput "discogs pone totaltracks temp"
say "|74/"
sayoutput "discogs pone totaltracks temp"
say "|75/"
sayoutput "discogs pone totaltracks temp"
say "|76/"
sayoutput "discogs pone totaltracks temp"
say "|77/"
sayoutput "discogs pone totaltracks temp"
say "|78/"
sayoutput "discogs pone totaltracks temp"
say "|79/"
sayoutput "discogs pone totaltracks temp"
say "|80/"
sayoutput "discogs pone totaltracks temp"
say "|81/"
sayoutput "discogs pone totaltracks temp"
say "|82/"
sayoutput "discogs pone totaltracks temp"
say "|83/"
sayoutput "discogs pone totaltracks temp"
say "|84/"
sayoutput "discogs pone totaltracks temp"
say "|85/"
sayoutput "discogs pone totaltracks temp"
say "|86/"
sayoutput "discogs pone totaltracks temp"
say "|87/"
sayoutput "discogs pone totaltracks temp"
say "|88/"
sayoutput "discogs pone totaltracks temp"
say "|89/"
sayoutput "discogs pone totaltracks temp"
say "|90/"
sayoutput "discogs pone totaltracks temp"
say "|91/"
sayoutput "discogs pone totaltracks temp"
say "|92/"
sayoutput "discogs pone totaltracks temp"
say "|93/"
sayoutput "discogs pone totaltracks temp"
say "|94/"
sayoutput "discogs pone totaltracks temp"
say "|95/"
sayoutput "discogs pone totaltracks temp"
say "|96/"
sayoutput "discogs pone totaltracks temp"
say "|97/"
sayoutput "discogs pone totaltracks temp"
say "|98/"
sayoutput "discogs pone totaltracks temp"
say "|99/"
sayoutput "discogs pone totaltracks temp"
say "|"
set "discogs pone totaltracks temp"

As you can see, it works only for a maximum of 99 tracks, but you can extend it as long as you like. It works with the same logic as the say "01|02|03|04|05|06|07|08|09|" solution in the other topic.




For the more complicated way I'm using now, here is the code:
QUELLTEXT
# TRACK COUNTER
gotoline 3
findline "Tracklist</span>"
findline "<table"
joinuntil "</table>"
regexpreplace "class=\"track_pos\"" " <<<Track>>>I<<<Track>>> "
regexpreplace ".*?(<<<Track>>>.*<<<Track>>>).*" "$1"
regexpreplace "<<<Track>>>[^I].*?<<<Track>>>" "<<<Track>>>"
replace "<<<Track>>>" ""
do                                                    # get seperated tracknumbers
    regexpreplace "^(I)(I+)" "$2|$1$2"
    findinline "I"
while "I"
unspace
replace "IIIIIIIIII" "X"
replace "XXXXXXXXXX" "C"
replace "CI" "C0I"
regexpreplace "X($|\|)" "X0$1"
regexpreplace "C($|\|)" "C00$1"
replace "CCCCCCCCC" "9"
replace "CCCCCCCC" "8"
replace "CCCCCCC" "7"
replace "CCCCCC" "6"
replace "CCCCC" "5"
replace "CCCC" "4"
replace "CCC" "3"
replace "CC" "2"
replace "C" "1"
replace "XXXXXXXXX" "9"
replace "XXXXXXXX" "8"
replace "XXXXXXX" "7"
replace "XXXXXX" "6"
replace "XXXXX" "5"
replace "XXXX" "4"
replace "XXX" "3"
replace "XX" "2"
replace "X" "1"
replace "IIIIIIIII" "9"
replace "IIIIIIII" "8"
replace "IIIIIII" "7"
replace "IIIIII" "6"
replace "IIIII" "5"
replace "IIII" "4"
replace "III" "3"
replace "II" "2"
replace "I" "1"

# DISCOGS~TRACK NUMBER / TOTALTRACKS
outputto "discogs pone track / totaltracks temp"
sayuntil "|"
say "/"
sayregexp "(\d+)$"
do
    say "|"
    movechar 1
    sayuntil "|"
    say "/"
    sayregexp "(\d+)$"
while "|" 30
unspace
sayregexp "(\d+)$"

...
QUELLTEXT
# TRACK FIX: DISCOGS~TRACK NUMBER / TOTALTRACKS
outputto "title"
sayoutput "tracks"
outputto "track"
sayoutput "discogs pone track / totaltracks temp"
set "discogs pone track / totaltracks temp"


The first stands in the middle of my scripts, the second at the end.
I think you you can use it for your beatport script, if you just replace the first nine lines with this:
QUELLTEXT
# TRACK COUNTER
gotoline 1
joinuntil "<name>Users Also Bought</name>"
regexpreplace "</track>" "<<<Track>>>I<<<Track>>>"
regexpreplace ".*?(<<<Track>>>.*<<<Track>>>).*" "$1"
regexpreplace "<<<Track>>>[^I].*?<<<Track>>>" "<<<Track>>>"
replace "<<<Track>>>" ""



And here is the protocol of these parts from the debug file. It's for a release with 12 tracks.
Attached File  debug_track_totaltrack.txt ( 62.32K ) Number of downloads: 102


Please tell me the exact script-lines you don't understand, if you have further questions. I'm always willing to help if I find the time.

The new core elements are
QUELLTEXT
do                                                    # get seperated tracknumbers
    regexpreplace "^(I)(I+)" "$2|$1$2"
    findinline "I"
while "I"

this transforms
IIIIIIIIIIII
(was later transformed to 12 = totaltrack)
to
I|II|III|IIII|IIIII|IIIIII|IIIIIII|IIIIIIII|IIIIIIIII|IIIIIIIIII|IIIIIIIIIII|III
IIIIIIIII
(is later transformed to 1|2|3|4|5|6|7|8|9|10|11|12 = all tracknumbers, the last one representing also totaltracks)
So I have now at this point my own track counter and are not longer dependend on the one built into Mp3tag. This also enables me to write exact as many tracknumbers as I need and drop the long list or 99 say ... sayoutput ... seqeuences of my first solution.

the second new element is this:
QUELLTEXT
do
    say "|"
    movechar 1
    sayuntil "|"
    say "/"
    sayregexp "(\d+)$"
while "|" 30

it parses the web site at the line 1|2|3|4|5|6|7|8|9|10|11|12
always saying moving to the next number (movechar 1) saying that number (sayuntil "|") and then saying the the last number (sayregexp "(\d+)$")

EDIT:
I have now idea why i limited the do ... while loop to 30. Also it seems to have no effect as tracknumbers higher than 30 are also written without problem. I think I just left it there from the process of finding the right code for this loop where i had some proplems with infinite loops which let Mp3tag crash. I will delete this in the next update.

This post has been edited by pone: Nov 9 2011, 03:20
Go to the top of the page
 
+Quote Post
stevehero
post Nov 9 2011, 04:32
Post #67


Member


Group: Full Members
Posts: 573
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.65



QUOTE (pone @ Nov 9 2011, 01:02) *
You still don't use the debug file, do you? You can see there every step the script does.

Yes, I do but it confuses me sometimes, especially with something as complex as this. And its also a matter of knowing exactly what to do with the information it outputs. So I have attached my debug file to show you a problem I have. If you take a look at line 16 it says:

CODE
Output         : >http://www.beatport.com/release/dark-beat/381430<

Should this be the case? After all the command is 'gotoline 1'
Attached File  debug_totaltrack.txt ( 190.11K ) Number of downloads: 114

I have managed to get the track/total track and totaltrack outputs to work. So thank you very much. Code below is what I used. And you are right it is a more complicated method.

CODE
# TRACK COUNTER
debug "on" "F:\PROGRAMS\music\Mp3tag\debug totaltrack.txt"
gotoline 1
joinuntil "<name>Users Also Bought</name>"
regexpreplace "</track>" "<<<Track>>>I<<<Track>>>"
regexpreplace ".*?(<<<Track>>>.*<<<Track>>>).*" "$1"
regexpreplace "<<<Track>>>[^I].*?<<<Track>>>" "<<<Track>>>"
replace "<<<Track>>>" ""
do # GET SEPERATED TRACKNUMBERS
regexpreplace "^(I)(I+)" "$2|$1$2"
findinline "I"
while "I"
unspace
replace "IIIIIIIIII" "X"
replace "XXXXXXXXXX" "C"
replace "CI" "C0I"
regexpreplace "X($|\|)" "X0$1"
regexpreplace "C($|\|)" "C00$1"
replace "CCCCCCCCC" "9"
replace "CCCCCCCC" "8"
replace "CCCCCCC" "7"
replace "CCCCCC" "6"
replace "CCCCC" "5"
replace "CCCC" "4"
replace "CCC" "3"
replace "CC" "2"
replace "C" "1"
replace "XXXXXXXXX" "9"
replace "XXXXXXXX" "8"
replace "XXXXXXX" "7"
replace "XXXXXX" "6"
replace "XXXXX" "5"
replace "XXXX" "4"
replace "XXX" "3"
replace "XX" "2"
replace "X" "1"
replace "IIIIIIIII" "9"
replace "IIIIIIII" "8"
replace "IIIIIII" "7"
replace "IIIIII" "6"
replace "IIIII" "5"
replace "IIII" "4"
replace "III" "3"
replace "II" "2"
replace "I" "1"
# TOTALTRACKS
outputto "totaltracks"
sayregexp "(\d+)$"
# TRACK / TOTALTRACKS
outputto "beatport stevehero track / totaltracks temp"
sayuntil "|"
say "/"
sayregexp "(\d+)$"
do
say "|"
movechar 1
sayuntil "|"
say "/"
sayregexp "(\d+)$"
while "|"
unspace
sayregexp "(\d+)$"
# TRACK FIX: TRACK / TOTALTRACKS
outputto "title"
sayoutput "tracks"
outputto "track"
sayoutput "beatport stevehero track / totaltracks temp"
set "beatport stevehero track / totaltracks temp"

So the only thing left to get working is the leading zeros on the tracks. Im not to fused about it but I'm just curious to know how to implement it. I can handle looking at the debug.txt file on more simple matters but this is beyond me for the time being. I hope you understand.

QUOTE (pone @ Nov 9 2011, 01:02) *
Please tell me the exact script-lines you don't understand, if you have further questions. I'm always willing to help if I find the time.

I suppose you wouldn't be up to maybe use skype some time to go over some things. Its quite difficult to get a grasp sometimes through this.

QUOTE (pone @ Nov 9 2011, 01:02) *
EDIT:
I have now idea why i limited the do ... while loop to 30. Also it seems to have no effect as tracknumbers higher than 30 are also written without problem. I think I just left it there from the process of finding the right code for this loop where i had some proplems with infinite loops which let Mp3tag crash. I will delete this in the next update.

I have deleted the 30 in the loop and it works without a problem.


--------------------
▶✚♬ ═‎​ ♡
Go to the top of the page
 
+Quote Post
pone
post Nov 9 2011, 12:08
Post #68


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



ZITAT(stevehero @ Nov 9 2011, 04:32) *
QUELLTEXT
Output         : >http://www.beatport.com/release/dark-beat/381430<

Should this be the case? After all the command is 'gotoline 1'

The Output line always shwos the output of the field of the last outputto command. I this was WWW at you example. Gotoline 1 doesn't change anything for the output. When you use outputto "totaltracks" in line 337, the output is set to zero at the debug file..

ZITAT(stevehero @ Nov 9 2011, 04:32) *
So the only thing left to get working is the leading zeros on the tracks. Im not to fused about it but I'm just curious to know how to implement it. I can handle looking at the debug.txt file on more simple matters but this is beyond me for the time being. I hope you understand.

You should be able to take it from my script without modifications. It uses the tracknumber as they are after the # TRACK COUNTER part of the script, before the # TRACK / TOTALTRACKS part.
So for a release with 12 tracks, it parses the text:
1|2|3|4|5|6|7|8|9|10|11|12

The code is this:
QUELLTEXT
replace "|" "-|-"
regexpreplace "(^|$)" "-"
findinline "@@@" 1 1                                 #move to end of line
movechar -1
findinline "|" -1 1
if "-|"
     movechar 4
endif
if "-"                                                #one digit
     regexpreplace "-(\d)-" "-0$1-"
else
     movechar 1
     if "-"                                            #two digits
         regexpreplace "-(\d)-" "-0$1-"
     else
         movechar 1
         if "-"                                        #three digits
             regexpreplace "-(\d)-" "-0$1-"
             regexpreplace "-(\d\d)-" "-0$1-"
         else                                        #four digits
             regexpreplace "-(\d)-" "-0$1-"
             regexpreplace "-(\d\d)-" "-0$1-"
             regexpreplace "-(\d\d\d)-" "-0$1-"
         endif
     endif
endif
replace "-" ""

this is what it does:
line 1-2: put dashes around every number, so the parsed text is now -1-|-2-|-3-|-4-|-5-|-6-|-7-|-8-|-9-|-10-|-11-|-12-
line 3-5: move the parser in front of the last number
line 6-8: check if the follows another number (i had to put this in to avoid an error if there is only one track. the version of my script you can download doesn't have that yet)
line 9-26: these lines check the postion of the dash after the last track number. the parser jumps to the next character with movechar 1 until it finds the dash. when it is direct after the first digit of last tracknumber, the last tracknumber must be 1-9, so the script adds no leading zero.
when the dash is after the scecond digit of last tracknumber, the last tracknumber must be 10-99, so the script adds one leading zero to every track with only one digit. And so on... I stopped at four digits, which means it works to a maximum of 9999 totaltracks. Should be enough wink.gif
line 27: deletes the dashes from the parsed text again, so you have the same text what you had before, only with leading zeros, in our 12 tracks example, it's:
01|02|03|04|05|06|07|08|09|10|11|12

ZITAT(stevehero @ Nov 9 2011, 04:32) *
I suppose you wouldn't be up to maybe use skype some time to go over some things. Its quite difficult to get a grasp sometimes through this.

i've deinstalled skype as it seems to crash my computer from time to time. you can add me on facebook if you are there, so we would be able to clear things via chat. send me a pm.

This post has been edited by pone: Nov 9 2011, 12:10
Go to the top of the page
 
+Quote Post
stevehero
post Nov 9 2011, 14:04
Post #69


Member


Group: Full Members
Posts: 573
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.65



QUOTE (pone @ Nov 9 2011, 11:08) *
The Output line always shwos the output of the field of the last outputto command. I this was WWW at you example. Gotoline 1 doesn't change anything for the output. When you use outputto "totaltracks" in line 337, the output is set to zero at the debug file..

The problem is this for more than just one line. If you take a look, over 20 lines are the same output?

CODE
"Output         : >http://www.beatport.com/release/dark-beat/381430<"

QUOTE (pone @ Nov 9 2011, 11:08) *
You should be able to take it from my script without modifications.

I've tried it and it works like a charm.

QUOTE (pone @ Nov 9 2011, 11:08) *
this is what it does:
line 1-2: put dashes around every number, so the parsed text is now -1-|-2-|-3-|-4-|-5-|-6-|-7-|-8-|-9-|-10-|-11-|-12-.....I stopped at four digits, which means it works to a maximum of 9999 totaltracks. Should be enough wink.gif

Thank you and lol :]

QUOTE (pone @ Nov 9 2011, 11:08) *
i've deinstalled skype as it seems to crash my computer from time to time. you can add me on facebook if you are there, so we would be able to clear things via chat. send me a pm.

Cool, I'll send you a PM now.


--------------------
▶✚♬ ═‎​ ♡
Go to the top of the page
 
+Quote Post
stevehero
post Nov 10 2011, 00:26
Post #70


Member


Group: Full Members
Posts: 573
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.65



QUOTE (pone @ Nov 9 2011, 11:08) *
line 6-8: check if the follows another number (i had to put this in to avoid an error if there is only one track. the version of my script you can download doesn't have that yet)

I have noticed a problem when it comes to this part of the script.

CODE
# TRACK / TOTALTRACKS
outputto "beatport stevehero track / totaltracks temp"
sayuntil "|"
say "/"
sayregexp "(\d+)$"
do
    say "|"
    movechar 1
.....

The debug.txt file lists the problem as this:

CODE
Script-Line    : 381
Command        : movechar
Parameter 1    : >1<

Aborted: ERROR(L381/movechar): position not found

So the problem lies with movechar 1. I have checked your v3.11 script to see if the problem existed there also. I tried this release http://www.discogs.com/Axwell-Axwell-Subma...release/1086081. And I'm sorry to say that it does. :/




--------------------
▶✚♬ ═‎​ ♡
Go to the top of the page
 
+Quote Post
pone
post Nov 10 2011, 18:12
Post #71


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



ZITAT
The problem is this for more than just one line. If you take a look, over 20 lines are the same output?

because the output doesn't change for over 20 line. no say or sayout command. the output line of the debug file shows the output a field until the given line of the script.


ZITAT(stevehero @ Nov 10 2011, 00:26) *
I have noticed a problem when it comes to this part of the script.

So the problem lies with movechar 1. I have checked your v3.11 script to see if the problem existed there also. I tried this release http://www.discogs.com/Axwell-Axwell-Subma...release/1086081. And I'm sorry to say that it does. :/


tanks for reporting. i'll fix it. that's a problem i have at my script with all the different possible settings. with my personal settings there is no problem, but with TRACK/TOTALTRACKS there is. so i just didn't notice and did not enough tests with different settings.
Go to the top of the page
 
+Quote Post
pone
post Nov 11 2011, 02:00
Post #72


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



ZITAT(stevehero @ Nov 10 2011, 00:26) *
I have noticed a problem when it comes to this part of the script.

QUELLTEXT
# TRACK / TOTALTRACKS
       outputto "beatport stevehero track / totaltracks temp"
       sayuntil "|"
       say "/"
       sayregexp "(\d+)$"
       do
           say "|"
           movechar 1
       .....


I fixed it. Make the do ... while loop conditional by enclosing it with if "|" ... endif

QUELLTEXT
# TRACK / TOTALTRACKS
outputto "beatport stevehero track / totaltracks temp"
sayuntil "|"
say "/"
sayregexp "(\d+)$"
if "|"
     do
         say "|"
         movechar 1
         sayuntil "|"
         say "/"
         sayregexp "(\d+)$"
     while "|"
endif
unspace
sayregexp "(\d+)$"


This post has been edited by pone: Nov 11 2011, 02:21
Go to the top of the page
 
+Quote Post
TAR21
post Nov 11 2011, 11:41
Post #73


Member


Group: Members
Posts: 4
Joined: 24-September 11
Member No.: 15318
Mp3tag Version: 2.49



hey is there anyway you could implement bpm and maybe even a key readout?? or can you tell me how i can write it into the script? i imagine it's probably simple but i have no experience with this. thanks in advance!
Go to the top of the page
 
+Quote Post
stevehero
post Nov 12 2011, 02:20
Post #74


Member


Group: Full Members
Posts: 573
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.65



QUOTE (TAR21 @ Nov 11 2011, 10:41) *
hey is there anyway you could implement bpm and maybe even a key readout?? or can you tell me how i can write it into the script? i imagine it's probably simple but i have no experience with this. thanks in advance!

please this post forums.mp3tag.de/index.php?showtopic=14479&view=findpost&p=58853

im on my phone atm so hope that link works.

Thanks pone for the fix. I see you updated the options for your script. Good work as usual.


--------------------
▶✚♬ ═‎​ ♡
Go to the top of the page
 
+Quote Post

5 Pages V  « < 3 4 5
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th October 2014 - 22:11