Goto line 1 doesn't exist

Here's my bp script.

[Name]=beatport.com [v5.0 by stevehero™] (◣_◢)
[BasedOn]=https://www.beatport.com
[IndexUrl]=https://www.beatport.com/search/releases?q=%s&per-page=150&sort=release-desc
[AlbumUrl]=
[WordSeparator]=+
[IndexFormat]=% ↓ ID (◣_◢)™%|% ↓ RELEASE%|% ↓ ARTIST/S%|%_URL%
[Encoding]=url-utf-8
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
[ParserScriptIndex]=...
findline "<!DOCTYPE html>"
findinline "<!DOCTYPE html>"
joinuntil "</html>"
replace "|" "$verticalBar()"
regexpreplace "(?i).*?window\.Playables\s*?=\s*?(\{.+);.*?window\.Sliders\s+=\s+\[.*" "$1"
json "ON" "current"
json_foreach "releases"
json_select "id" # ID
sayrest
say "|"
json_select "name" # RELEASES
sayrest
say "|"
json_select_many "artists" "name" " ● " # ARTIST(S)
sayrest
say "|"
say "https://www.beatport.com/release/" # PREVIEW
json_select "slug"
sayrest
json_select "id"
say "/"
sayrest
saynewline
json_foreach_end
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
[ParserScriptAlbum]=...
debug "on" "C:\Users\yourusername\Desktop\debug album BEATPORT.html"        # Place before headings to want to debug
gotoline 1

Result in a debug error.

Aborted: ERROR(L53/gotoline): line does not exist

Line 1 should always exist should it not?


I should mention that this throws this error when the gotoline 1 is placed further down the code. I've removed that for clarity.

I think gotoline always fails when a line is empty. Not really useful since there is no error handling possible.
I hope it gets changed, either no error on empty lines or allow gotoline 1 1 to ignore it.

True. This leaves it kind of impossible to back track to the start. That is if there are instances where line 5 in beatports html pages is not the first line that's not empty in all cases.

The 1 1 trick will work if it returns or skips to the very 1st valid line that contains text. In my case 5.

This should be fixed with Mp3tag v3.00a. It now doesn't fail on empty lines, only on lines that doesn't exist.

Thanks for pointing!

2 Likes