admin管理员组文章数量:1323029
Caveat: Yes, I know that imgpurpython is not maintained, this has however worked for me quite recently.
I have a simple python3 application that uses the OAuth authorization to call into imgur's API. I mainly use it to upload small sets (4, maybe 5) of images at once, and add them all to an album.
Up until recently, the application worked quite well, and would upload the images and add them to a (hidden) album. The album just makes it easier for me to see the images grouped on the imgur posts page.
Today I was trying to do this again after several months. The application ran fine, and uploaded all 3 images, but then failed to create the album, saying
imgurpython.helpers.error.ImgurClientError: (400) Unable to decode request body
The request data for the album creation uses the correct url, it has a sane body (as prescribed by the imgur API documentation). Has imgur changed its API without updating the Documentation?
PS: I don't exceed the usage limits, and I don't upload insensitive stuff. I don't think I'm being throttled or anything, because I've re-tried the application a couple of times now, and the image uploading always works - only the album creation fails.
EDIT: Here is the request details, which I print out by modifying imgurpython right before executing the request:
method_to_call: <function post at 0x1035b42c0>
url:
header: {
'Authorization': 'Bearer [...]'},
data: {
'privacy': 'hidden',
'title': 'test'
}
I know the 'privacy' entry is deprecated, but it has not been sunset yet, according to the API documentation.
This fails with the following error response:
error: {'status': 400, 'success': False, 'data': {'error': 'Unable to decode request body', 'request': '/3/album', 'method': 'POST'}}
本文标签: imgurimgurpython39s createalbum failsStack Overflow
版权声明:本文标题:imgur - imgurpython's create_album fails - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742110096a2421208.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论