bandsnatch icon indicating copy to clipboard operation
bandsnatch copied to clipboard

Apparently, the `CONTENT_DISPOSITION` header can't generally be assumed to be present

Open amandasystems opened this issue 1 year ago • 2 comments

I'm getting spurious errors like this one:

trying c3711951006, Secluded Creek - Amanita (false)                            ░░░░░░░░░░ (56.69 KiB/7.09 MiB) 
ASHAMED f/Lauren Mayberry - HEALTH              
thread '<unnamed>' panicked at /home/amanda/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bandsnatch-0.3.2/src/api/mod.rs:274:66:
called `Option::unwrap()` on a `None` value

amandasystems avatar Aug 02 '24 09:08 amandasystems

Well that's strange. Is this happening multiple times, and around the same album(s)?

Ovyerus avatar Aug 06 '24 13:08 Ovyerus

Yes, for some of them consistently and for some spuriously. I’ll look around and try to get you a full trace.

amandasystems avatar Aug 06 '24 19:08 amandasystems

This is what I get when turning on debug logging:

Trying p104712518, Five Alive - Doomtree (true)
[2024-09-06T11:04:17Z DEBUG reqwest::connect] starting new connection: https://popplers5.bandcamp.com/
[2024-09-06T11:04:17Z DEBUG reqwest::async_impl::client] redirecting 'https://popplers5.bandcamp.com/download/track?enc=mp3-320&id=2774431893&sig=[REDACTED]&sitem_id=104712518' to 'https://bandcamp.com/download?payment_id=[REDACTED]&sig=[REDACTED]'
thread '<unnamed>' panicked at /home/amanda/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bandsnatch-0.3.2/src/api/mod.rs:274:66:

Interesting enough this album doesn't show up in my "My purchases list", but it is a purchase I have made. I think the link has somehow expired? The only way they will allow me to download it is via email link.

I think a warning with "could not download...", plus possibly the link it tried to use is enough.

amandasystems avatar Sep 06 '24 11:09 amandasystems

Aha! Yes, this happens if you make a purchase with an email that isn't linked to your account. So for example if you've purchased music as [email protected], switch to [email protected] and remove the previous one from your account, the music may not show up in your list and will cause this error. It baffles me why bandsnatch can even see the music listed, but apparently it could.

amandasystems avatar Sep 06 '24 11:09 amandasystems

For the record the spurious errors have not appeared again, so they must be rare.

amandasystems avatar Sep 06 '24 11:09 amandasystems

Wow, that's a weird edge case! Bizarre that Bandcamp doesn't show it in your collection but apparently keeps it around in the data Bandsnatch picks up. I'll add a better warning for when a download fails as you suggested.

Ovyerus avatar Sep 06 '24 13:09 Ovyerus

I keep running into 'em it seems. Thanks!

amandasystems avatar Sep 06 '24 13:09 amandasystems

Added that warning in v0.3.3.

Ovyerus avatar Sep 07 '24 13:09 Ovyerus