[question]: Several folders end up empty with `DownloadInvalidContentType`
Several folders end up empty with the error referenced here:
https://github.com/meeb/bandcampsync/blob/8e4a7c9414e0c93f85e38f306338f956a3095743/bandcampsync/download.py#L53
[INFO] New media item, will download: "EatSleep / When I Sing To It" (id:2776362121) in "flac"
[INFO] Downloading item "EatSleep / When I Sing To It" (id:2776362121) from https://popplers5.bandcamp.com/download/track?enc=flac&id=2776362121&sig=[masked]&sitem_id=338381705 to /var/tmp/tmpp2l4zolx
[ERROR] Download attempt returned an unexpected content type (Invalid content type: text/html), skipping
Is this because of rate limiting? Should the next round be able to pick up from that and download all the missing files?
I've not seen this behaviour myself, ideally you'd need to click through to the download and see what that HTML file is that's returned instead of the actual download for me to be able to patch it.
Could it be related to the fact that some downloads expire and you need to re auth with an email? Or is that thing handled in some other way?
That might be it, but you can test that by confirming your login then re-updating your cookies to see if that fixes it.
I don't think that download link expiration is linked to the normal bandcamp.com session. Despite being logged in, for some items in my collection i get this:
{
"result": "err",
"retry_url": "",
"errortype": "ExpirationError",
"date": "2025-09-16 09:13:49 UTC",
"url": "popplers5.bandcamp.com/statdownload/track?enc=flac&id=XXXXXXXXX&sig=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&sitem_id=XXXXXXXXX&.rand=XXXXXXXXXXX&.vrs=1",
"host": "scruffycentral-grbw-1"
}
Then i am presented a form where you must specify the email you used to purchase the item. In my case is the same as my account but that doesn't seem relevant.
Finally i get a new download link via on that email address with:
http://bandcamp.com/download?payment_id=XXXXXXXXXX&reauth_sig=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&reauth_ts=XXXXXXXXXX&sig=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Yeah that rings a bell from when I saw it once a couple of years back. There doesn't seem much I can automate there without entering your email address and clicking the link. If I remember you can't create the link in the email in full programmatically. You might just have to make sure you're not seeing the "enter your email" form on the website occasionally unfortunately. Even if you could generate the link and attempt to automatically auth again it would be extremely difficult to test reliably.
I tried to achieve it in this project here, by filling the email and tracking an inbox, but i haven't made it work fully. It was not very reliable and certainly not easy to test, but in theory it could be done.
I managed to trigger the download link email using a POST request
https://github.com/fibonacid/Bandcamper/blob/f87dd4a8456552ce95de02dce1ac43bc1021a85a/downloader/collection_downloader.go#L185
Thanks, looks useful. I'll take another look but I likely won't attempt to implement it if it can't be done reliably given it'll just annoy people otherwise. If I can reliably get it to work I'll stuff it in the next version.