[Name]=beatport.com [v5.0 by stevehero™] (◣_◢)
[BasedOn]=https://www.beatport.com
[IndexUrl]=https://www.beatport.com/search/releases?q=%s&per-page=25&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]=...
# START JSON PARSING
gotoline 5
findline "<!DOCTYPE html>"
findinline "<!DOCTYPE html>"
joinuntil "</html>"
replace "|" "$verticalBar()"
regexpreplace "(?i).*?window\.Playables\s*?=\s*?(\{.+);.*?window\.Sliders\s+=\s+\[.*" "$1"
regexpreplace "\"tracks\": ?\[\s*\]\," "" # Remove empty tracks array
json "ON" "current"
json_select_array "releases" 1
# THERE'S A PROBLEM WITH THIS SELECTING AN ARRAY AND RETURNING THE TOTAL TRACK COUNT
outputto "TOTALTRACKS"
json_foreach "tracks"
sayrest
json_foreach_end
json_unselect_object # Deselect releases
json_unselect_object # Deselect tracks
The above outputs 0 to the TOTALTRACKS field when AFAIK should count the length of the arrray.
Perhaps it's something I'm doing here.
Here's a similar issue that was resolved. Perhaps it's something on mp3tags' end @Florian ?
I'm removing empty arrays beforehand with:
regexpreplace "\"tracks\": ?\[\s*\]\," "" # Remove empty tracks array
so all I'm left with is the correct one but so far I've not been able to get this working.