Instead of extracting each image from the HTML page of its track (one additional request per track), they can also be extracted from the embedded player (one additional request in total).
This approach even works for pre-releases where the files have already been uploaded although the track pages themselves are not even accessible before the release.
An embedded player can be fetched from https://bandcamp.com/EmbeddedPlayer/album=${albumId}, where albumId is the numeric internal ID from the tralbum JSON.
The interesting JSON data is embedded into a player-data data attribute on that HTML page.
Unfortunately the embedded player JSON data includes a lot of bloat about any(?) merch offered by that artist/label for whatever reason, but this is still more efficient than downloading the HTML of each track.
Instead of extracting each image from the HTML page of its track (one additional request per track), they can also be extracted from the embedded player (one additional request in total). This approach even works for pre-releases where the files have already been uploaded although the track pages themselves are not even accessible before the release.
An embedded player can be fetched from
https://bandcamp.com/EmbeddedPlayer/album=${albumId}
, wherealbumId
is the numeric internal ID from thetralbum
JSON. The interesting JSON data is embedded into aplayer-data
data attribute on that HTML page.Example: https://chillhop.bandcamp.com/album/chillhop-essentials-summer-2024 -> https://bandcamp.com/EmbeddedPlayer/album=3871800458
Unfortunately the embedded player JSON data includes a lot of bloat about any(?) merch offered by that artist/label for whatever reason, but this is still more efficient than downloading the HTML of each track.