Add a friendly user agent

This commit is contained in:
Cadence Ember 2025-04-09 20:57:00 +12:00
parent bd9bb656ac
commit 13699d163d
2 changed files with 7 additions and 7 deletions

View file

@ -1,14 +1,14 @@
# BC Explorer # BC Explorer
explore your bandcamp collection online https://bcexplorer.world
well, mostly online? you still need to run this application for yourself on your computer, so it isn't truly web scale Explore your Bandcamp collection online!
but the idea is you can more easily search your whole collection and play it streaming without downloading every mp3 to your computer and using a media player You can easily search your whole collection and play it streaming rather than downloading every mp3 to your computer and using a media player.
(you _should_ download every mp3, though, because the bandcamp tos says they can take away your online access at any time) (you _should_ download every mp3, though, because the Bandcamp TOS says they can take away your online access at any time)
## how to use ## run your own version
1. npm install 1. npm install
2. node start.js 2. node start.js
@ -16,7 +16,7 @@ but the idea is you can more easily search your whole collection and play it str
## import more reliable statistics ## import more reliable statistics
by default, the data is mostly correct, but you can do this to get the exact data by default, the data is mostly correct, which is good enough for me, but you can do this to get the exact data
1. log into bandcamp in your browser 1. log into bandcamp in your browser
2. in the top right, click the button to view your collection, should take you to a url like https://bandcamp.com/cloudrac3r 2. in the top right, click the button to view your collection, should take you to a url like https://bandcamp.com/cloudrac3r

View file

@ -48,7 +48,7 @@ class TagDownloader extends sync.reloadClassMethods(() => TagDownloader) {
this.processed = 0 this.processed = 0
try { try {
for (const {account, item_id, item_type, item_title, item_url, band_name} of this.untaggedItems) { for (const {account, item_id, item_type, item_title, item_url, band_name} of this.untaggedItems) {
const res = await fetch(item_url) const res = await fetch(item_url, {headers: {"user-agent": "BC Explorer (+https://bcexplorer.world)"}})
// delete unreachable items, otherwise it will perpetually try to download tags for them // delete unreachable items, otherwise it will perpetually try to download tags for them
if (res.status === 404) { if (res.status === 404) {