我正在尝试使用 Python 中的
Instaloader
模块从 Instagram 下载带有短代码列表的照片。几次成功下载后,我收到以下错误:
ConnectionException:对 graphql/query 的 JSON 查询:HTTP 错误代码 401.
我的代码示例如下:
import instaloader
L = instaloader.Instaloader()
for i,v in shortcodes.items():
post = instaloader.Post.from_shortcode(L.context, shortcodes[i])
L.download_post(post, target=post.owner_username)
如果能解决我的问题,我将不胜感激。
如果它早些时候可以工作但现在不工作,你可能已经达到了 API 速率限制。在这种情况下,您可能需要等到速率限制被重置或调整您发出请求的速率以保持在限制范围内。