Some /track/ URLs on Bandcamp represent singles (often with their own cover art) that aren't otherwise released as part of an album.
It seems you can distinguish these from album tracks by checking TrAlbumCurrent.album_id, which is null for tracks without an associated album. (Perhaps there is another, more obvious way that I missed.)
In the second commit, I was able to extract an ISRC for these tracks where available. (Apparently Bandcamp only embeds ISRCs on track pages, not album pages?)
This is probably very hacky since I was still trying to wrap my head around the codebase, but I'm happy to improve it.
Standalone track with credits, no ISRC (note: for this example, the track is also available on an album, but the album links to a different track page, "ambrosia-2")
Some
/track/
URLs on Bandcamp represent singles (often with their own cover art) that aren't otherwise released as part of an album.It seems you can distinguish these from album tracks by checking
TrAlbumCurrent.album_id
, which isnull
for tracks without an associated album. (Perhaps there is another, more obvious way that I missed.)In the second commit, I was able to extract an ISRC for these tracks where available. (Apparently Bandcamp only embeds ISRCs on track pages, not album pages?)
This is probably very hacky since I was still trying to wrap my head around the codebase, but I'm happy to improve it.
A few URLs I tested with: