Mambaul Hisam
Fri Jun 27 2025
BDown, Music Scrapper
Who listen to music? Almost everyone. In this content i will cover BDown, a MP3 scrapper for Bandcamp, and how it works. But, before we continue, i need clarify. Scrapping is a gray area in the glasses of law, consider reviewing your lawsuit you lived in.
Music Enjoyer
I personally do listen to music day to day, specifically Black Metal and their sub-genres. My first journey about this extreme genres are in the middle school. I got recommendation from my friend, i listen to it. Since then, i do explore more band with same kind of music on YouTube and later on Bandcamp.
Yes, YouTube allows you to repeat a song infinite times, but Bandcamp's is not. You need to install Bandcamp mobile app to listen in infinite repeat mode. It's annoying for me personally, i need to worries about this and i make this project.
How it Flows
Diving into HTML
Same as any other kind of scrapping, i need to analyze the HTML structure and related JavaScript behind. Luckily, Bandcamp has embeding raw MP3 format files on their band's album/song page, gotcha!. You can find it as JSON object in script tag. With some regex you can capture it.
The Regex
The regex were used something like this: /"trackinfo":[(.*?)]/. It's captures JSON object that we mention early in the script tag. Yeah, it's shown perfect if you look at the DevTools. The problem is, if you using tool like JavaScript's fetch, you need to escape the characters like: " (quote), & (ampersand) and other to perfectly parsable as JavaScript's JSON.
{
...
"trackinfo": [
{
"id": 2570030...,
"track_id": 2570030...,
"file": {
"mp3 - 128": "https://t4.bcbits.com/stream/..."
},
"artist": null,
"title": "Bleak, damp, and d...",
"encodings_id": 2083553...,
"license_type": 4,
"private": null,
"track_num": 1,
....
},
....
]
...
}
The JSON object it self, contain a object with "file" field contain the links to the MP3 files as show above. After getting the JSON tree, now we can construct the JavaScript JSON object.
Host it!
I'm using Cloudflare Workers to host the REST API and the page. It's have 2 endpoint. Firstly, the root "/" endpoint, it's gives you HTML landing page response. The /parse endpoint, this API performs scrapping process, from fetching given url and return the scrapped JSON object.
The UI
We use web as user our interface. I don't built it my self. With help of my friends to design the UI, i can implement the UI using basic HTML and CSS. Not to forgot, i do giving them a credit in the below of the page. The note is, the history feature is not implemented as it shown in the page.
After you fill the form with link from band's bandcamp album/song page, click search icon. Wait some while, until you see a table with song/s inside. You can listen to the song by clicking "Click Me!".
Quality
Don't expect too much. It's 128 kbps, but it's still listenable to me and i can say "enough". But if you're audiophile, don't use this project, it will crap out your ears for sure.
Legal
As i say earlier, this is a gray area, you should be kind and wisdomful. If your ignorance more obvious, do with your own risk.
Demo
Check this out: https://bdown.whoevencares.com/