when I try to import releases, images are not being imported. this is a *new* issue, just started a few days ago on my productions site (Nothing has changed on my site, no updates, no changes, nothing ).
Everything imports okay, but the files get written my "covers" directory are only 20 bytes or so. Logs error is this:

imagecache 08/14/2011 - 15:21 403: File is not an image ...

Any ideas?

Comments

Karlheinz’s picture

Another user reported this as well. No idea what's going on, it sounds like something on Discogs.com's end. I will investigate tonight after I eat dinner...

Karlheinz’s picture

Assigned: Unassigned » Karlheinz
Status: Active » Needs review
StatusFileSize
new1.34 KB

Found the issue...

Checking on the Discogs.com forums, it appears that this happens whenever the HTTP request does not supply a "User-Agent" header. I was actually using PHP's fopen() function to read the file from the URI, which naturally doesn't supply that header.

I've switched to using drupal_http_request() instead, which does show that header. That function returns an object, with the data as a field to that object; hopefully it won't mess up with large files.

I tested this on my machine, and it works. I pushed this to 6.x-1.x, and am attaching a patch. Also, I'm switching this issue to "Needs review." Please test, and report any "suspicious behavior," as the Feds say.

strawberrybrick’s picture

patch worked, thanks _again_ Karl

strawberrybrick’s picture

Getting another error now, no image imported. After rest imports, there's an error:

"Failed to open http://s.dsimg.com/image/R-2736713-1298733113.jpeg"

strawberrybrick’s picture

And today it works (still using the patch from this bug)..... sorry!

Karlheinz’s picture

You know, that happened to me a couple of times too... it always resolved itself, and I was never able to figure out what was wrong. It happened occasionally ever since I started developing the site, and I think it's something wonky on Discogs.com's end. But I don't have a clue what causes it or how to fix it.

Tell me if you run into the problem again. Also, if you can, try to simply copy and paste the URL into your browser, and see if that works. If it does, obviously it must be something on my end.

Karlheinz’s picture

Status: Needs review » Fixed

After re-writing for Discogs API v.2, I'm closing this issue as fixed. Re-open if it happens again.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.