[WS] Bandcamp (search by Album or Track)

Bandcamp Tag Source

This Bandcamp Tag Source allows for searching by album or track title via bandcamp.com

Download

bandcamp-0.4.2.zip (4.5 KB)

Requires Mp3tag v3.22 or Mp3tag for Mac v1.8.6.

Supported Fields

ARTIST
ALBUM
TITLE
TRACK
TOTALTRACKS
GENRE (currently lowercase only)
KEYWORDS Bandcamp keywords
RELEASETIME
YEAR YYYY or YYYY-MM-DD based on settings.
COMMENT Bandcamp description
CREDITS Bandcamp credits
WWW Bandcamp URL

It also fetches cover art in good quality. If you want the highest possible quality, please enable the respective configuration setting.

Changelog

0.4.2 (2023-09-17) @Florian

  • Added support for cover thumbnails in search results (macOS-only).
  • Added configuration setting for YEAR format.
  • Added configuration setting to use highest quality for cover art.
  • Added configuration settings to omit albums or tracks from search results.
Further changes

0.4.1 (2023-09-13) @Florian

  • Added error handling in case search term returns no results.
  • Fixed typo in WordSeparator configuration setting, which effectively removed every space character from the query before it was sent to Bandcamp.

0.4.0 (2023-09-12) @Florian

  • Changed to use JSON representation for parsing album part.

0.3.4 (2023-09-11) @Florian

  • Fixed track numbers and titles are not always listed correctly.

0.3.3 (2021-06-13) @ms6676749

  • Changed to return artist and track results only.

0.3.2 (2021-04-26) @ms6676749

  • Updated to modified search page.

0.3.1 (2020-10-08) @ms6676749

  • Fixed broken Tag Source.

0.3.0 (2020-09-28) @ms6676749

  • Fixed broken Tag Source.

0.2.0 (2019-01-16) @Florian

  • Fixed broken Tag Source.

0.1.3 (2017-06-18) @ms6676749

  • Minor fixes.

0.1.2 (2016-06-26) @ms6676749

  • Minor fixes.

0.1.1 (2016-05-16) @ms6676749

  • Minor fixes.

0.1.0 (2016-04-11) @ms6676749

  • Initial release.
5 Likes

Updated. I have more luck searching , so I set the index parser to search that field accordingly.

1 Like

Updated. First time I used it in awhile and I noticed that it had difficulty parsing one of the variants of "trackinfo: "

Fixed for now...

Updated websource. Sorry about the jankiness from my older Bandcamp scripts. Admittedly, they were done in a hurry. No one mentioned anything to me here, so I thought they worked well for others. Again, I don't use Bandcamp all that much, so I tested this recently and found the one I posted from last year was broken. This one should be much better (using sayregexp now). See OP for new src file.

Umm, how do I query an artist?
I don't have any albums, only individual Songs but nearly all of them are on bandcamp and got a cover there.

Artist pages often times don't have the track info you're looking for. Also, one would need to go to another page, which is beyond what the index parser can do (index -> URL; not index -> URL -> URL2).

I updated the initial post to include a source that permits searching for single tracks.

Just wanted to say thanks for the nice web source. It's great that Bandcamp is accessible from Mp3tag :slight_smile:

Kind regards
— Florian

1 Like

I downloaded the source. It works well to find the track on Bandcamp but all the tags fields are then empty.
I'm pretty sure it is caused by the structure of the website that must have changed. Do you have any update or could you help me with some tips on how to adapt the source to make it work ?

Many thanks

I've fixed the Track-based search and updated the web source in the first post.

It's mostly in working order still, but I've had two odd problems with this:

  1. Tracks 7 and all the way down are repeated with track 1. I've done many, but this issue is oddly specific to this album/page.

  2. Song titles with quotation are being attached (escaped?) with backslashes (so "). It's not a huge deal, but it requires extra steps in tagging by having to use $replace otherwise it'll output some odd file type/name shenanigans.

Seems to be an undesirable result - has also been noted in a German thread:

When attempting to tag a single file, looking for albums will only return the first track for some reason. Is there a way to fix this? Also, is there a way to produce a full date format e.g. 2017-07-28?

When you buy something on Bandcamp, usually you already know the URL. Sometimes the search of the script doesn't find the release even though it is letter for letter like on Bandcamp. Hence it would pretty great to have an option to enter the URL manually instead of just searching for it.

Can this be added to the script?

try this:
Bandcamp#U&RL.src (3.5 KB)

1 Like

Bandcamp changed their site, so here are updated websources for album searching (1st websource) or simply paste the URL into the search window (2nd websource). It doesn't grab as many info fields as before. Just keeping it simple with the basics.

Bandcamp - Default.src (3.8 KB)
Bandcamp - URL.src (2.6 KB)

2 Likes

Hello @all,

Is it also possible to include the Bandcamp track URL in the tags?

Thank you very much for an answer.

It is saved as BANDCAMP_URL in the tags. If you want to save it in the more common tag field WWW, then open up the src file in notepad, or your favorite text editor, and change the line outputto "BANDCAMP_URL" to outputto "WWW"

Anyways, bandcamp changed their pages again, so here's updated src files:

&Bandcamp#&1 Def&ault.src (4.7 KB) &Bandcamp#&2 &URL.src (3.6 KB)

1 Like

Thank you very much for your answer.
Unfortunately that was not exactly what I meant.
When I look at the source code of the album page, there is a part:
" <script type="application/ld+json">"
there URLs of the individual tracks are stored.
As an example:
"{"numTracks":19, "track":{"itemListElement":[{"position":1, "item":{"@id": "https://subterraneanrecords.bandcamp.com/track/aive-veitstanz", "name": "Aive - Veitstanz","@type": "MusicRecording", "duration": "P00H04M48S"},"@type": "ListItem"}"

and there I would have liked to output "@id", in the example "https://subterraneanrecords.bandcamp.com/track/aive-veitstanz".

I have not yet quite figured out how to find and output this data.

Just add this section before or after any of the sections (e.g. # Bandcamp_URL and its code) listed below the big ALBUM heading. Be aware that some releases do not have track URL's for every track, so those pages will mess up the output of this section.

# Bandcamp_Track_URL
gotoline 3
findline "<script type=\"application/ld+json" 1 1
ifnot ""
	outputto "BANDCAMP_TRACK_URL"
	moveline 1
	unspace
	regexpreplace "(^.*?position\"\:)" ""
	regexpreplace "(?:.*?)(https\:\/\/.+?\.bandcamp\.com\/track\/.+?)(\")" "$1]["
	regexpreplace "^" "["
	sayregexp "(?<=\[).+?(?=\])" "|" ","
endif
2 Likes

Best :grinning:
It works perfect. :+1:
Slowly, but only really slowly, I also understand how the data is found and put together.

I should really take a look at rule expressions.

Thanks again for the quick help.