BandcampDownloader icon indicating copy to clipboard operation
BandcampDownloader copied to clipboard

Rename cover art filename to png if wrongly named by Bandcamp

Open celynw opened this issue 4 years ago • 2 comments

I've noticed something strange when downloading the cover art.

I have set the following options to try and get a single, maximum quality file (hopefully PNG).

🗹 Save in folder     ☐ Convert to JPG     ☐ Constrain maximum width/height

I still always end up with a cover.jpg. When I go to look at what the maximum quality should be, bandcamp presents me with a address ending in .jpg, but apparently this is actually a PNG image. And it seems the file downloaded by BandcampDownloader is also a PNG disguised as a JPG. URLs for both file extensions work, but diff says they are identical (makes sense).

Original `.jpg`

1 Screenshot 2020-11-06 153743

`.png` version

2 Screenshot 2020-11-06 154234

Output of BandcampDownloader

3 Screenshot 2020-11-06 153915

For a different album, (one used in #64) it really is a JPG, even if you ask for the PNG.

Original `.jpg`

4 Screenshot 2020-11-06 154352

`.png` version

5 Screenshot 2020-11-06 154404

Output of BandcampDownloader

6 Screenshot 2020-11-06 154507

I guess the short question, is if the downloaded files could have the correct extension?

celynw avatar Nov 06 '20 16:11 celynw

Good catch! Not sure why Bandcamp renames PNG images to .jpg.

I'll have to see if I can rely on the Content-Type header to rename the file accordingly.

Otiel avatar Nov 08 '20 14:11 Otiel

It is not Bandcamp, but Bandcamp Downloader uses jpg extension to save. If you request any image without extension (i.e. https://f4.bcbits.com/img/a2498578482_0) - you will get the correct format, at least this works in browser.

Also to topic starter - original is original, you can't request png or jpg, it will always be what is uploaded by author.

DarkVoyage avatar May 17 '23 12:05 DarkVoyage