ImageShare is unable to upload to Imgur API
Closed this issue · 2 comments
The production version of ImageShare is currently unable to upload images to Imgur, because the API returns this error:
string(109) "{"data":{"error":"Imgur is temporarily over capacity. Please try again later."},"success":false,"status":403}"
My local setup with the same Docker container and same API key still works, so I assume this is a (hopefully unintentional) IP block. I've updated the upload code to use binary files instead of base64-encoded images, and tried moving the server to a different DigitalOcean region, but nothing changed there. I also rolled out basic error handling, so ImageShare won't silently fail when an upload fails (which was generating a QR code that linked to the Imgur home page).
This shouldn't be related to Imgur's terms of service change:
There are no planned upcoming changes to Imgur’s API offerings. With this update, we are focused on the content that is uploaded to Imgur, not how the content is uploaded to Imgur
I'll update this thread as I investigate other solutions.
I've rolled out a temporary fix that uploads images to imgbb.com when the Imgur API fails, like the original version of ImageShare. The production server is now using the imgbb-support
branch with those changes. ImgBB doesn't support anonymous uploads in the same way as Imgur, so as a half-solution, images are deleted after 120 seconds.
The code is pretty messy, and the privacy policy and other pages need to be updated to explain the differences. If there aren't any issues, I can look into adding ImgBB as a permanent image host option. That will probably require the user to provide their own API key, so pictures are tied to their account instead of the ImageShare account.
Imgur API suddenly started working again a while ago, and I haven't noticed it break again. I'm leaving the production server on the imgbb-support
branch for now, but this issue can be closed.