[WS] Bandcamp (search by Album or Track)

because downloading very big cover image

1 Like

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 "\""`

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

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 "\""
1 Like

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 "\""

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

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

&Bandcamp#&1 Def&ault.src (4.6 KB)

3 Likes

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:

# 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:

# 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 (6.0 KB)

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

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

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).

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:
    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?