Question about fetching images #131
-
I’ve been trying to fetch release images, but every time I get a URL that I think leads to a release image, the file is always 249.3 kb and is unable to be open. I have opened one of the urls and there is no image appearing. I am authenticated through my user key. In addition, it appears release images all generate urls indicating a size of maximum 600x600. Any help or sample code would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hey @captain-cronch Can you provide us with some example releases that this happened with? I tried the following and got an valid link to an image. print(client.release(18424870).images[0]["uri"])
# https://i.discogs.com/rbgsspwMTX95LTy4GJEGCl4gFouCyOHIySrTHM0vFWI/rs:fit/g:sm/q:90/h:600/w:600/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTE4NDI0/ODcwLTE2MTkxODc2/OTktNDEyOS5qcGVn.jpeg |
Beta Was this translation helpful? Give feedback.
-
Specificially, this is the code I am currently working with:
print(r.release.images[0]["uri"]) returns valid urls that I am able to view on my PC. I am attempting to save the files on a raspberry pi. The most recent release I tested was 11155125. From what I can tell, personal access token should be sufficient. I tested release 18424870 and the same holds true, I can return the url, but have no luck saving the image. Edit: additional update, I tried oAuth instead of a personal access token and I still wasn't able to save files. I think I forgot to mention it, but when I have tried print(response) in the past, I receive a 403 error and I'm still not entirely sure why |
Beta Was this translation helpful? Give feedback.
After perusing the discogs API forum some more, it looks like there's a chance that cloudflare has anti-scraping measures that prevent me from downloading the file without taking some counter measures first. I'll be looking into that, but if anyone has any solutions, I'd love to hear them.