# \[WS\] Bandcamp (search by URL)

**URL:** https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838
**Category:** Web Sources Scripts
**Created:** [April 11, 2016, 6:54pm UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838 "2016-04-11T18:54:39Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![xaoc](https://community.mp3tag.de/user_avatar/community.mp3tag.de/xaoc/32/12614_2.png) [@xaoc](https://community.mp3tag.de/u/xaoc)
#### Post date: [October 24, 2020, 3:55pm UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/21 "2020-10-24T15:55:49Z")

</div>

> [@Maitol](#):
>
> Slowly, but only really slowly, I also understand how the data is found and put together.

because downloading very big cover image

---

<div class="post-metadata">

### Author: ![ms6676749](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@ms6676749](https://community.mp3tag.de/u/ms6676749)
#### Post date: [October 27, 2020, 6:18am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/22 "2020-10-27T06:18:37Z")

</div>

> Slowly, but only really slowly

Like @xaoc mentioned, one solution to performance issues is to comment out the `# Coverart` section using "#" to prevent the websource from downloading the full-size cover art as shown below. Alternatively, comment out the line `replace "3.jpg" "0.jpg"` so that it will only download the small preview coverart.

```
# Coverart
#gotoline 3
#outputto "COVERURL"
#findline "link rel=\"shortcut icon\"" 1 1
#replace "3.jpg" "0.jpg"
#findinline "href=\"" 1 1
#sayuntil "\""`

```

---

<div class="post-metadata">

### Author: ![deesar](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/958977/32.png) [@deesar](https://community.mp3tag.de/u/deesar)
#### Post date: [November 10, 2020, 10:04am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/23 "2020-11-10T10:04:46Z")

</div>

if you want to dl the 700x700 jpg instead of the 3000x3000 jpg or the tiny 100x100 jpg edit the coverart part like this:

`findline "link rel=\"image_src\"" 1 1`

---

<div class="post-metadata">

### Author: ![deesar](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/958977/32.png) [@deesar](https://community.mp3tag.de/u/deesar)
#### Post date: [November 10, 2020, 10:57am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/24 "2020-11-10T10:57:16Z")

</div>

To set the full Date in "YEAR" like this 2020-11-10 edit the last lines of the Month / Date Part

```
# Month / Date
gotoline 3
findline "<meta name=\"description" 1 1
ifnot ""
moveline 1
regexpreplace "(?:^.*released )" ""
regexpreplace "(\d+)(?: )(\w+)(?: )(\d{4})" "$3\.$2\.$1\""
replace "January" "01"
replace "February" "02"
replace "March" "03"
replace "April" "04"
replace "May" "05"
replace "June" "06"
replace "July" "07"
replace "August" "08"
replace "September" "09"
replace "October" "10"
replace "November" "11"
replace "December" "12"
replace "." "-"
outputto "YEAR"
#	saynchars 4
#	findinline "." 1
#	outputto "MONTH_DAY"
	sayuntil "\""
```

---

<div class="post-metadata">

### Author: ![ms6676749](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@ms6676749](https://community.mp3tag.de/u/ms6676749)
#### Post date: [November 13, 2020, 8:58am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/25 "2020-11-13T08:58:28Z")

</div>

Thanks for the code. I will have to add though that the code above will output YEAR as 2020.11.10. Here's the code for YEAR to output as "2020-11-10" (without quotes)

```
gotoline 3
findline "<meta name=\"description" 1 1
ifnot ""
moveline 1
regexpreplace "(?:^.*released )" ""
#regexpreplace "(\d+)(?: )(\w+)(?: )(\d{4})" "$3\.$2\.$1\""
regexpreplace "(\d+)(?: )(\w+)(?: )(\d{4})" "$3-$2-$1\""
replace "January" "01"
replace "February" "02"
replace "March" "03"
replace "April" "04"
replace "May" "05"
replace "June" "06"
replace "July" "07"
replace "August" "08"
replace "September" "09"
replace "October" "10"
replace "November" "11"
replace "December" "12"
replace "." "-"
outputto "YEAR"
#	saynchars 4
#	findinline "." 1
#	outputto "MONTH_DAY"
	sayuntil "\""
```

---

<div class="post-metadata">

### Author: ![JDar\_NX](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/c4cdca/32.png) [@JDar\_NX](https://community.mp3tag.de/u/JDar_NX)
#### Post date: [April 21, 2021, 3:02am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/26 "2021-04-21T03:02:58Z")

</div>

I'm no longer getting some of the tags and other info from the source how do I fix this?

---

<div class="post-metadata">

### Author: ![ms6676749](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@ms6676749](https://community.mp3tag.de/u/ms6676749)
#### Post date: [April 26, 2021, 10:40am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/27 "2021-04-26T10:40:37Z")

</div>

I just noticed that bandcamp tweaked their search page a little bit. Here's the updated bandcamp src.

[&Bandcamp#&1 Def&ault.src](https://community.mp3tag.de/uploads/short-url/z91374pefSLe2GdDZ3oxQD1A8W.src) (4.6 KB)

---

<div class="post-metadata">

### Author: ![ms6676749](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@ms6676749](https://community.mp3tag.de/u/ms6676749)
#### Post date: [June 13, 2021, 6:27pm UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/28 "2021-06-13T18:27:28Z")

</div>

The search from the last update was a little wonky, so I redid it to omit "artist" and "fan" hits from the search query. The new search will find album and track hits from the search.

Fields obtained from this src:

ARTIST, ALBUM, TRACK, TITLE, YEAR, \_LENGTH, WWW

Fields that are set as blank (can be restored if set FIELD lines at the bottom are commented with "#"):

BANDCAMP\_COMMENT, CREDITS, MONTH\_DAY

Again, if there are performances issues due to the downloading of huge cover art and you only want the small preview cover art, then replace the `# Coverart` section with the following:

```auto
# Coverart
gotoline 3
outputto "COVERURL"
findline "link rel=\"shortcut icon\"" 1 1
#replace "3.jpg" "0.jpg"
findinline "href=\"" 1 1
sayuntil "\""

```

If you don't want any coverart, then just comment out the entire `# Coverart` section like this:

```auto
# Coverart
#gotoline 3
#outputto "COVERURL"
#findline "link rel=\"shortcut icon\"" 1 1
#replace "3.jpg" "0.jpg"
#findinline "href=\"" 1 1
#sayuntil "\""

```

[&Bandcamp#&1 Def&ault.src](https://community.mp3tag.de/uploads/short-url/wfVrgO9RTxx7ymVnvz5oaOrhrh9.src) (6.0 KB)

---

<div class="post-metadata">

### Author: ![Mrakobes666](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/8797f3/32.png) [@Mrakobes666](https://community.mp3tag.de/u/Mrakobes666)
#### Post date: [November 11, 2021, 9:30am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/29 "2021-11-11T09:30:46Z")

</div>

Thank you so much for your hard work. Please correct - %artist% gets in the title of the track, and it needs to be separated and sent to %album artist%

Déhà - Summertime Depression  
02 Déhà - Introspection  
Déhà & VaathV - Saraph  
04 Déhà & Dominique Van Cappellen-Waldock - Vacuum  
Déhà & Patri - Apocalepse - Vegan Curry  
Déhà & Patri - Apocalepse - Better Fat in Hell than Thin in Heaven  
07 Déhà & Patri - Apocalepse - Specureese's  
Déhà & Patri - Apocalepse - Apocalepse  
Déhà - Summertime Bliss

![](https://community.mp3tag.de/uploads/default/original/2X/8/8cc20f4ad02cc94e1c78ccbf4447efdb15155cb7.png)

---

<div class="post-metadata">

### Author: ![Mrakobes666](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/8797f3/32.png) [@Mrakobes666](https://community.mp3tag.de/u/Mrakobes666)
#### Post date: [November 11, 2021, 9:36am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/30 "2021-11-11T09:36:37Z")

</div>

Damn, in my opinion there were broken files, probably a false alarm

---

<div class="post-metadata">

### Author: ![ms6676749](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@ms6676749](https://community.mp3tag.de/u/ms6676749)
#### Post date: [March 27, 2022, 3:18am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/31 "2022-03-27T03:18:40Z")

</div>

Often for compilations, artist names are included in the trackname data without any indication that there are artist names there. If I modify the webpage data to lookup artist names via the dash character, then that might open up a new can of worms for songs on non-compilation albums having dash characters in their titles (e.g., the websource now incorporates some parts of the title into the field).

---

<div class="post-metadata">

### Author: ![Arbiter](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@Arbiter](https://community.mp3tag.de/u/Arbiter)
#### Post date: [January 24, 2023, 8:58am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/32 "2023-01-24T08:58:21Z")

</div>

I noticed two issues with the results.

1. If enabled, BANDCAMP\_COMMENT contains the HTML character code instead of the actual characters for apostrophes, ampersands, and pipes. I corrected that by inserting the following at line 195:

```auto
    replace "&#39;" "'"
	replace "&amp;" "&"
	replace "|" ":"

```

That was copied from elsewhere in the script where it serves the same purpose.

1. The last track number and track title appears be concatenating the whole list of track numbers and track titles respectively, connected by pipes. The example in the image is highlighted. I have not been able to determine the cause as the div for the final track number appears consistent with the others, but my web design knowledge is very basic. It seems like it is not terminating at the end of the table for the tracklist.

Does anyone know how to correct the source to read the final track number correctly?

 ![Screenshot 2023-01-24 at 3.56.03 AM](https://community.mp3tag.de/uploads/default/original/2X/2/20b2928ca8151047ca0237f31f9289cddae2a66e.jpeg)

---

<div class="post-metadata">

### Author: ![Leo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Leo](https://community.mp3tag.de/u/Leo)
#### Post date: [September 7, 2023, 10:00pm UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/33 "2023-09-07T22:00:47Z")

</div>

Hello,

Is everything working good for you. I'm using the mac version of the app. I'm able to find results when the application is then crashing when fetching metadata

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [September 8, 2023, 9:16am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/34 "2023-09-08T09:16:36Z")

</div>

Can you provide a search term and a description on how to reproduce the crash?

Are you using the Tag Source from this linked topic or a different one?

> [@\[WS\] Bandcamp (search by Album or Track)](https://community.mp3tag.de/t/ws-bandcamp-search-by-album-or-track/17838/28):
>
> The search from the last update was a little wonky, so I redid it to omit "artist" and "fan" hits from the search query. The new search will find album and track hits from the search. Fields obtained from this src: ARTIST, ALBUM, TRACK, TITLE, YEAR, \_LENGTH, WWW Fields that are set as blank (can be restored if set FIELD lines at the bottom are commented with "#"): BANDCAMP\_COMMENT, CREDITS, MONTH\_DAY Again, if there are performances issues due to the downloading of huge cover art and you on…

---

<div class="post-metadata">

### Author: ![Leo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Leo](https://community.mp3tag.de/u/Leo)
#### Post date: [September 8, 2023, 1:03pm UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/35 "2023-09-08T13:03:08Z")

</div>

Yes I am.

Here is a video of the issue [bandcamp\_repro.mp4 - pCloud](https://u.pcloud.link/publink/show?code=XZwJ63VZUxFf0UlGijbNgfJc8AfFO4v9n0t7)

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [September 11, 2023, 8:57pm UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/36 "2023-09-11T20:57:18Z")

</div>

Thank you for the detailed report via video. I've reproduced the issue and have fixed it with [Mp3tag for Mac v1.8.6](https://community.mp3tag.de/t/mp3tag-for-mac-v1-8-released/61431/11).

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [September 11, 2023, 9:00pm UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/37 "2023-09-11T21:00:12Z")

</div>

> [@Arbiter](#):
>
> The last track number and track title appears be concatenating the whole list of track numbers and track titles respectively, connected by pipes.

I've fixed the script to correctly list the track numbers and titles.

[&Bandcamp#&1 Def&ault.src](https://community.mp3tag.de/uploads/short-url/qNdQdT7wTPVlcRNcikSnQ0E0hfL.src) (5.9 KB)

---

<div class="post-metadata">

### Author: ![Arbiter](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@Arbiter](https://community.mp3tag.de/u/Arbiter)
#### Post date: [September 12, 2023, 5:17am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/38 "2023-09-12T05:17:50Z")

</div>

Thanks Florian! That did resolve the issue with concatenation.

I don't know if you want to get sucked in to doing anything more with this script, but it is still reading HTML codes literally in the search results and most tags. I'm working on trying to correct that with some ugly replace commands in every section for the results and the tags. Is there a better option that wouldn't require manually listing every HTML tag and code in use by BandCamp, for each section of the script for each audio tag?

For example, when searching for [this album](https://ericbuchholz.bandcamp.com/album/hero-of-time-music-from-the-legend-of-zelda-ocarina-of-time) the quotes in the album title are left as HTML symbol codes, and likewise with line break and anchor HTML tags.

Here's my draft revisions so far started with Florian's recent update to the script.  
[4. Bandcamp (Edited).src](https://community.mp3tag.de/uploads/short-url/a30zitilJ030GjTpN0Xbur4X2UG.src) (6.4 KB)

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [September 12, 2023, 10:52am UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/39 "2023-09-12T10:52:24Z")

</div>

I've noticed that the individual release pages also include a JSON-representation of the data, so I took the opportunity and have rewritten the album part of the tag source.

This also addresses the issue with the HTML tags and character codes.

I haven't added any settings to the tag source, but if any of you who are actively using the tag source have specific needs or ideas please comment.

The genre is lowercase at the moment, so this would need to be addressed in post-processing until we find a way of doing this inside the tag source.

[&Bandcamp#&JSON.src](https://community.mp3tag.de/uploads/short-url/9I671ws9A4xHY1FpsAZy62sSYU0.src) (5.3 KB)

And @ms6676749, I have no intention to take over the script — just wanted to get things going and share what I came up with. If you want to include this in a next version of the tag source, please use it freely.

---

<div class="post-metadata">

### Author: ![Leo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Leo](https://community.mp3tag.de/u/Leo)
#### Post date: [September 12, 2023, 10:00pm UTC](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838/40 "2023-09-12T22:00:03Z")

</div>

@Florian, thanks for updating the app version of mac. I still have an issue but a different one. Using the script attached.

If I query: A/B Sides 027  
it returns  
**ERROR(L31/findline): text not found.**

[Previous page](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838.md?page=1)

[Next page](https://community.mp3tag.de/t/ws-bandcamp-search-by-url/17838.md?page=3)
